Exclude does not work on karma.conf.js file

3,016 views
Skip to first unread message

José Vicente Sogorb Morón

unread,
Jul 25, 2013, 11:47:53 AM7/25/13
to karma...@googlegroups.com
Hello Everybody,

I am configuring Karma to work in may project based on AngularJs and RequireJs. When I start Karma I can see in my web browser how it loads app/js/main.js even if the file is excluded. Am I missing any trick?

Thank you in advance

Here are my file:

karma.conf.js:
basePath = '../';

files = [
  JASMINE,
  JASMINE_ADAPTER,
  REQUIRE,
  REQUIRE_ADAPTER,
  {pattern: 'app/js/*.js',       included: false},
  {pattern: 'app/js/**/*.js',    included: false},
  {pattern: 'app/lib/**/*.js',   included: false},
  {pattern: 'test/unit.js',      included: false},
  {pattern: 'test/unit/*.js',    included: false},
  {pattern: 'test/unit/**/*.js', included: false},
  {pattern: 'test/lib/**/*.js',  included: false},
  'test/main-test.js'
];

exclude   = ['app/js/main.js'];
reporters = ["progress"];
autoWatch = true;
LogLevel  = LOG_DEBUG;
browsers  = ['Chrome'];

junitReporter = {
  outputFile: 'test_out/unit.xml',
  suite: 'unit'
};

main-test.js
require.config({
baseUrl: '/base/app/js/',
paths: {
angular:      '/base/app/lib/angular/angular',
angularMocks: '/base/test/lib/angular/angular-mocks',
text:         '/base/app/lib/require/text',
fixtures:     '/base/test/unit/fixtures'
},
shim: {
'angular' : {'exports' : 'angular'},
'angularMocks': {deps:['angular'], 'exports':'angular.mock'}
},
priority: [
"angular"
]
});

require( [
'angular',
'app',
'angularMocks',
'/base/test/unit.js' //list all your unit files here

], function(angular, app) {
window.__karma__.start();
});



José Vicente Sogorb Morón

unread,
Jul 25, 2013, 11:50:13 AM7/25/13
to karma...@googlegroups.com
I have one question related with this subject. There is any way to get a list of file that will be watch by karma?

José Vicente Sogorb Morón

unread,
Jul 25, 2013, 12:56:28 PM7/25/13
to karma...@googlegroups.com
Is it possible that exclude does not listen the base path? Seems working when i exclude the file '../app/js/main.js'.


El jueves, 25 de julio de 2013 17:47:53 UTC+2, José Vicente Sogorb Morón escribió:

Vojta Jína

unread,
Jul 27, 2013, 11:30:36 AM7/27/13
to karma...@googlegroups.com


--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages