When running on Travis, Karma reports 0 of N tests executed
See original GitHub issueI’m trying to make my Karma/Angular tests work on Travis as described here, but it keeps saying that 0 tests were executed:
Running "karma:test" (karma) task
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser Firefox
INFO [Firefox 31.0.0 (Linux)]: Connected on socket C7AVrV2cfPpQquGp3ew4 with id 60880131
Firefox 31.0.0 (Linux): Executed 0 of 4 SUCCESS (0 secs / 0 secs)
There’s no such issue when I run the same thing locally, it reports “4 of 4”. There’s also a blog post by @Swizec where eventually the same result described: “Executed 0 of 114 SUCCESS” (there’s a screenshot at the very end).
Here’s my set up:
.travis.yml
language: node_js
node_js:
- '0.11'
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
karma.conf.js
module.exports = function(config) {
var c = {
basePath: './',
files: [...],
autoWatch: true,
frameworks: ['jasmine'],
browsers: ['Firefox'],
plugins: [
'karma-firefox-launcher',
'karma-jasmine'
]
};
config.set(c);
};
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
...
karma: {
options: {
configFile: 'karma.conf.js'
},
'test': {
singleRun: true
}
},
...
});
...
grunt.loadNpmTasks("grunt-karma");
...
...
grunt.registerTask("fe-test", ["karma:test"]);
...
};
Did I miss something?
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Angular test fail to run on Travis with error "Found 1 load error"
I assume that you upgraded your project to Angular 13. I replaced karma-coverage-istanbul-reporter with karma-coverage and it works fine.
Read more >Common Build Problems - Travis CI Docs
A very common cause when a test is suddenly breaking without any major code changes involved is a change in upstream dependencies. This...
Read more >karma | Yarn - Package Manager
Karma. js-standard-style npm version npm downloads ... A simple tool that allows you to execute JavaScript code in multiple real ... 6.4.0 (2022-06-14)....
Read more >Travis CI - Karma test runner
Travis CI is a popular continuous integration service that integrates with your Github repository to automatically run your tests when code is pushed....
Read more >@egjs/karma-typescript - npm
Simplifying running unit tests with coverage for Typescript projects.. Latest version: 4.0.0, last published: 4 years ago.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had the same issue (tests running but reporter says 0 out of N). Changed reporter to “dots” now says correctly N out of N.
To me, removing `restartOnFileChange: true’ from my karma conf solved this error.