samedi 27 décembre 2014

karma-browserify Cannot find module on unit test

I am trying to use karma-browserify to launch some unit test on my angularjs project.


My karma.conf.js:



'use strict';

module.exports = function(config) {

config.set({
files: [
'src/client/test/**/*.js'
],
frameworks: ['browserify', 'jasmine'],
preprocessors: {
'src/client/test/**/*.js': ['browserify']
},

logLevel: 'LOG_DEBUG',

browsers: ['PhantomJS'],
reporters: ['coverage', 'spec', 'failed'],
browserify: {
debug: true
// transform: ['browserify-istanbul']
}
});
};


My unittest code:



'use strict';

describe('my first test', function() {

});


And here's the error I get by running "gulp test":



PhantomJS 1.9.8 (Windows 8) ERROR
Error: Cannot find module 'C:/Users/Davide/Documents/dev/src/client/test/unit/
firstTest.js'
at C:/Users/Davide/AppData/Local/Temp/8d853e52e1080008d772a561baf57f0daa455e27
.browserify:1:0 <- node_modules\karma-browserify\node_modules\browserify\node_mo
dules\browser-pack\_prelude.js:1:0
PhantomJS 1.9.8 (Windows 8) ERROR
Error: Cannot find module 'C:/Users/Davide/Documents/dev/src/client/test/unit/
firstTest.js'
at C:/Users/Davide/AppData/Local/Temp/8d853e52e1080008d772a561baf57f0daa455e27
.browserify:1:0 <- node_modules\karma-browserify\node_modules\browserify\node_mo
dules\browser-pack\_prelude.js:1:0


I cannot understand what is the problem since the error message doesn't explicitally say what module is missing. I think it is not a problem with dependencies since I runned "npm install" a few times.


Anyone has an idea?


Thanks


Aucun commentaire:

Enregistrer un commentaire