karma-jspm icon indicating copy to clipboard operation
karma-jspm copied to clipboard

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

Open unional opened this issue 8 years ago • 6 comments

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.

unional avatar Jul 10 '15 07:07 unional

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

kubawalinski avatar Jul 22 '15 18:07 kubawalinski

@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 avatar Aug 12 '15 15:08 riddla

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.)

riddla avatar Aug 12 '15 15:08 riddla

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

erfangc avatar Dec 24 '15 15:12 erfangc

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.

sod avatar Feb 03 '16 11:02 sod

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} ]

jshifrin25 avatar Feb 10 '16 22:02 jshifrin25