Revert "feat(core): add support for using async/await with Jasmine" (#25096)

This reverts commit f6829aba55e07609e312b4f67dbc9dbbf36e4e46.

PR Close #25096
This commit is contained in:
Miško Hevery
2018-07-25 10:19:44 -07:00
committed by Victor Berchet
parent 968f153491
commit e1c6fd5453
5 changed files with 59 additions and 132 deletions

View File

@ -1,34 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Converts an `async` function, with `await`, into a function which is compatible with Jasmine test
* framework.
*
* For asynchronous function blocks, Jasmine expects `it` (and friends) to take a function which
* takes a `done` callback. (Jasmine does not understand functions which return `Promise`.) The
* `jasmineAwait()` wrapper converts the test function returning `Promise` into a function which
* Jasmine understands.
*
*
* Example:
* ```
* it('...', jasmineAwait(async() => {
* doSomething();
* await asyncFn();
* doSomethingAfter();
* }));
* ```
*
*/
export function jasmineAwait(fn: () => Promise<any>):
(done: {(): void; fail: (message?: Error | string) => void;}) => void {
return function(done: {(): void; fail: (message?: Error | string) => void;}) {
fn().then(done, done.fail);
};
}

View File

@ -13,7 +13,6 @@
*/
export * from './async';
export * from './jasmine_await';
export * from './component_fixture';
export * from './fake_async';
export * from './test_bed';