Open brentoneill opened 7 years ago
Can you slim this down into a minimal reproduction in a repository?
If it helps, I have seen this error happen when there is a syntax error in one of my scripts. I would check to see if TypeScript isn't erroring out and the stack trace isn't being outputted. It might help to try wiring in tslint and running that to see if there are not any errors coming in there.
Closing as it appears the issues is with the karma-chrome-launcher
plugin - tests run fine on the FireFox launcher
Do you have a reference to an issue or any more information about the problem with karma-chrome-launcher
by any chance? I'm getting this problem, too.
Hi Guys. I don't know if it will solve your problem, but I came up with similar problem while running 'karma --single-run --browsers Chrome' from npm script. I would get an unclear npm error:
Chrome 61.0.3163 (Windows 10 0.0.0): Executed 0 of 0 ERROR (0.007 secs / 0 secs)
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\M.S.BIT\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "test"
npm ERR! node v6.9.4
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! karma_angular2@1.0.0 test: node ./node_modules/karma/bin/karma start --single-run --browsers Chrome
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the karma_angular2@1.0.0 test script 'node ./node_modules/karma/bin/karma start --single-run --browsers Chrome'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the karma_angular2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/karma/bin/karma start --single-run --browsers Chrome
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs karma_angular2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls karma_angular2
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! C:\dev\angular2_karma\npm-debug.log
At the end the problem was that I didn't had any tests and the script would fail. I finally solved it by adding : failOnEmptyTestSuite: false to my karma.conf.js file, so it won't fail the script when there are no tests. Hope it will help in any way.
Thank you @ibaraness. I spend two days because of this issue. I am writing my tests in TypeScript and somehow, karma is not picking up tests written in TypeScript. Now, at least I know the error. I can go further.
Seems like we could have the error message reflect the flag, eg failOnEmptyTestSuite
Chrome 61.0.3163 (Windows 10 0.0.0): Executed 0 of 0 && failOnEmptyTestSuite == true: ERROR (0.007 secs / 0 secs)
@mistyharsh Make sure you include the mime:
mime: {
'text/x-typescript': ['ts']
},
Steps for me to improve the error occurrence: I upgrade karma to v3x and added a custom launcher in karma.config with the flags below from an example online:
flags: [ '--headless', '--disable-gpu', // Without a remote debugging port, Google Chrome exits immediately. '--remote-debugging-port=9222' ]
Thanks @ibaraness!
I spent one entire day looking for a fix for this error, and finally found that I only had to add to my karma.conf.js:
failOnEmptyTestSuite: false
Expected behaviour
Tests should run as expected and open the browser window.
Actual behaviour
Environment Details
Karma version - 1.3.0 Config:
Steps to reproduce the behaviour
npm run test
2.Karma looks like its starting then it shows that it executes 0 of 0 tests when we have 133 in this repo.npm debug log