karma-runner / karma-qunit

A Karma plugin. Adapter for QUnit testing framework.
MIT License
51 stars 38 forks source link

Promise support #37

Closed sechel closed 6 years ago

sechel commented 8 years ago

There are problems when using the Promise features of qunit: A failing promise would abort the testsuite but report success with the number of tests passed before the rejecting promise.

qunit.test('rejecting promise test', function() {  
  return Promise.reject();  
});
"karma": "^0.13.21",
"karma-chrome-launcher": "^0.2.2",
"karma-coverage": "^0.5.3",
"karma-firefox-launcher": "^0.1.7",
"karma-qunit": "^0.1.9",
"karma-requirejs": "^0.2.5",
"karma-safari-launcher": "^0.1.1",
"karma-verbose-reporter": "0.0.3",
"karma-verbose-summary-reporter": "0.0.1",
"qunitjs": "^1.22.0",
sechel commented 8 years ago

Hmm, this seems to be more involved that just that. Invoking Promise.reject(new Error('fail')) remedies this issues.

Krinkle commented 6 years ago

@sechel This was an upstream issue with QUnit itself, not karma-qunit. I believe this has been fixed at some point. However, if you find that it is not working well on a current version of QUnit 2.x, then please create a new issue at https://github.com/qunitjs/qunit/issues.

See also: https://api.qunitjs.com/QUnit/test

@dignifiedquire I think this can be closed now :)

sechel commented 6 years ago

All good, thanks 👍