0
votes

I have a very simple karma/qunit test... here are my files:

karma.conf.js

module.exports = function(config) {
 config.set({
  basePath: '',
  frameworks: ['qunit'],
  files: [ "test.js" ],
  reporters: ['progress'],
  port: 9876,
  colors: true,
  logLevel: config.LOG_INFO,
  autoWatch: true,
  browsers: ['PhantomJS'],
  singleRun: false
});

};

package.json:

{"dependencies": {
  "karma": "*",
  "karma-qunit": "*"
 },
 "devDependencies": {
 "karma-phantomjs-launcher": "^0.1.2"
 }
}

and finally my qunit test.js file:

test( "equal test", function() {
  expect(6);
  equal( 0, 0, "Zero; equal succeeds" );
  equal( "", 0, "Empty, Zero; equal succeeds" );
  equal( "", "", "Empty, Empty; equal succeeds" );
  equal( 0, 0, "Zero, Zero; equal succeeds" );
  equal( "three", 3, "Three, 3; equal fails" );
  equal( null, false, "null, false; equal fails" );
});

Nothing fancy here! That's everything! The test assertions yield the expected results. But I get the message:

WARN [PhantomJS 1.9.7 (Mac OS X)]: Adapter did not report total number of specs.

and the last message is:

PhantomJS 1.9.7 (Mac OS X): Executed 1 of 0 (1 FAILED) ERROR (0.007 secs / 0.004 secs)

I get the same messages when I pass the expected number of tests as a parameter to the test function too.

Can anyone see what the problem might be? Is this a bug in karma-qunit? Thanks in advance for any insight you can offer.

1
I am having this same problem. The following is my attempt to strip the problem down to the bare bones code. See the readme for the exact commands I am running. github.com/jcummins/gulp-karma-qunit-total-tests-errorJimTheDev

1 Answers

0
votes

So as it turns out @lazd on github was able to figure this out that this is the blocking issue at qunit: https://github.com/jquery/qunit/issues/350