Karma-browserify Cannot find module on unit test

I am trying to use karma-browserify to run some unit test in 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 is the error I get when 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 can't figure out what the problem is, since the error message doesn't explicitly state which module is missing. I think this is not a dependency issue since I ran "npm install" several times.

Anyone have an idea?

thank

+3


source to share


1 answer


This is a known issue with windows. According to the question below, it has been fixed and is pending release.



https://github.com/nikku/karma-browserify/issues/86

+1


source







All Articles