Added a basic set of async matchers

- Fixes #1447
- Fixes #1547
This commit is contained in:
Steve Gravrock
2018-06-04 21:01:22 -07:00
parent 8f7327cb4d
commit 9472df0db4
16 changed files with 876 additions and 34 deletions

View File

@@ -167,6 +167,25 @@ getJasmineRequireObj().interface = function(jasmine, env) {
return env.expect(actual);
},
/**
* Create an asynchronous expectation for a spec. Note that the matchers
* that are provided by an asynchronous expectation all return promises
* which must be either returned from the spec or waited for using `await`
* in order for Jasmine to associate them with the correct spec.
* @name expectAsync
* @function
* @global
* @param {Object} actual - Actual computed value to test expectations against.
* @return {async-matchers}
* @example
* await expectAsync(somePromise).toBeResolved();
* @example
* return expectAsync(somePromise).toBeResolved();
*/
expectAsync: function(actual) {
return env.expectAsync(actual);
},
/**
* Mark a spec as pending, expectation results will be ignored.
* @name pending