UNPKG

1.01 kBJavaScriptView Raw
1/**
2 * @license
3 * Copyright Google Inc. All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8/**
9 * Injectable completer that allows signaling completion of an asynchronous test. Used internally.
10 */
11export var AsyncTestCompleter = (function () {
12 function AsyncTestCompleter() {
13 var _this = this;
14 this._promise = new Promise(function (res, rej) {
15 _this._resolve = res;
16 _this._reject = rej;
17 });
18 }
19 AsyncTestCompleter.prototype.done = function (value) { this._resolve(value); };
20 AsyncTestCompleter.prototype.fail = function (error, stackTrace) { this._reject(error); };
21 Object.defineProperty(AsyncTestCompleter.prototype, "promise", {
22 get: function () { return this._promise; },
23 enumerable: true,
24 configurable: true
25 });
26 return AsyncTestCompleter;
27}());
28//# sourceMappingURL=async_test_completer.js.map
\No newline at end of file