Add explicit fail and move on for async functions
- `done` now has a `fail` property which will call the global `fail` then continue to the next function in the queue [finish #73744618] Fix #567 Fix #568
This commit is contained in:
@@ -972,6 +972,12 @@ describe("Env integration", function() {
|
||||
message: 'Failed: messy message'
|
||||
})]
|
||||
}));
|
||||
expect(specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
||||
description: 'fails via the done callback',
|
||||
failedExpectations: [jasmine.objectContaining({
|
||||
message: 'Failed: done failed'
|
||||
})]
|
||||
}));
|
||||
expect(specDone).toHaveBeenCalledWith(jasmine.objectContaining({
|
||||
description: 'has a message from an Error',
|
||||
failedExpectations: [jasmine.objectContaining({
|
||||
@@ -997,6 +1003,12 @@ describe("Env integration", function() {
|
||||
}, 1);
|
||||
});
|
||||
|
||||
env.it('fails via the done callback', function(innerDone) {
|
||||
setTimeout(function() {
|
||||
innerDone.fail('done failed');
|
||||
}, 1);
|
||||
});
|
||||
|
||||
env.it('has a message from an Error', function(innerDone) {
|
||||
setTimeout(function() {
|
||||
env.fail(new Error('error message'));
|
||||
|
||||
Reference in New Issue
Block a user