I am setting up grunt with a karma task that looks for all the unit test files. I need to access all *.js
files, and *.spec.js
files, but I want to exclude all *.e2e.js
files. Based on the node glob documentation, I would expect the following to work (in karma.conf.js):
files: [
'vendor/angular/angular.js',
'vendor/angular-mocks/angular-mocks.js',
'vendor/angular-resource/angular-resource.js',
'app/**/*.js',
'!app/**/*.e2e.js'
],
However, when I try to run my grunt test
task, it still tries to load these e2e.js
tests, which break because each test references protractor, which karma get confused by. According to my console, I'm seeing URL's like this:
userdirectory/repo/!app/mytest.e2e.js
It seems that the full filepath (or at least some of it) is being preappended to the file glob pattern I supply in karma.conf.js. Is grunt doing this after the fact when it loads the karma task?