computmaxer / karma-jspm

Other
74 stars 50 forks source link

Need to watch for file updates (running karma from WebStorm) #69

Open unional opened 9 years ago

unional commented 9 years ago

After some trial and error, I can now run test on command line and WebStorm (horay!)

But there is one problem. Since WebStorm will keep the karma running, when I make a change to the code (adding a test for example), jspm does not pickup the change. When I run the test, the cached version is used. I have to stop the karma server and run it again so jspm could pick it up.

This work flow is working fine for karma-requirejs.

kubawalinski commented 9 years ago

I am running with singleRun: false in karma.conf.js and the tests are re-executed every time a file is changed.

riddla commented 9 years ago

@kubawalinski: You're sure about this? singleRun: false does not solve the problem for me. Changing some test code is not reflected e.g. Karma is serving the "cached" version. Any hints?

riddla commented 9 years ago

Reading about a similar problem at https://github.com/nikku/karma-browserify/issues/23 there might be a bug on WebStorms side: https://youtrack.jetbrains.com/issue/WEB-12496. (See also #38.)

erfangc commented 8 years ago

I can second that cli karma start works but the (in my case IntelliJ IDEA 15) version does not

sod commented 8 years ago

If you add this to your karma.conf.js:

        files: [
            {pattern: 'js/**/*.js', included: false}
        ],

It works for me in WebStorm. I guess the WebStorm karma plugin does watch itself but only watches globs in files. Not jspm.serveFiles.

jshifrin25 commented 8 years ago

Thanks sod,

I was having that problem with intellij 15, and your solution worked perfectly.

files: [ {pattern: 'test/unit/js/app/**/*.js', included: false}, {pattern: 'src/js/app/**/*.js', included: false} ]