question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When running on Travis, Karma reports 0 of N tests executed

See original GitHub issue

I’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:open
  • Created 9 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tnajdekcommented, Jul 19, 2015

Had the same issue (tests running but reporter says 0 out of N). Changed reporter to “dots” now says correctly N out of N.

0reactions
bernardolmcommented, Dec 1, 2015

To me, removing `restartOnFileChange: true’ from my karma conf solved this error.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found