-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: add fixture for rejected "begin", "moduleStart", "done" callbacks
I'm adding this as a CLI fixture instead of an HTML fixture because we don't currently have a good way of expecting a failure in an HTML test run. I've confirmed that the "hanging" appearance described in #1391 is equivalent to the "Process exited before tests finished running" message reported. Once we switch to capturing TAP by default, this will make the HTML tests much easier to verify no matter whether the pass/fail outcome. Ref #1391.
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var caught = []; | ||
|
||
QUnit.on('error', function (e) { | ||
caught.push(e.message); | ||
}); | ||
|
||
QUnit.begin(function () { | ||
return Promise.reject(new Error('begin')); | ||
}); | ||
|
||
QUnit.moduleStart(function () { | ||
return Promise.reject(new Error('moduleStart')); | ||
}); | ||
|
||
QUnit.testStart(function () { | ||
return Promise.reject(new Error('testStart')); | ||
}); | ||
|
||
QUnit.done(function () { | ||
setTimeout(function () { | ||
console.log('Caught errors from ' + caught.join(', ')); | ||
}, 100); | ||
}); | ||
|
||
QUnit.done(function () { | ||
return Promise.reject(new Error('done')); | ||
}); | ||
|
||
QUnit.test('one', function (assert) { | ||
assert.ok(true); | ||
}); | ||
|
||
QUnit.module('example', function () { | ||
QUnit.test('two', function (assert) { | ||
assert.ok(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters