1 | import { TestWaiter } from './';
|
2 | export declare function _resetWaiterNames(): void;
|
3 | /**
|
4 | * Builds and returns a test waiter. The type of the
|
5 | * returned waiter is dependent on whether the app or
|
6 | * addon is in `DEBUG` mode or not.
|
7 | *
|
8 | * @public
|
9 | *
|
10 | * @param name {string} The name of the test waiter
|
11 | * @returns {TestWaiter}
|
12 | *
|
13 | * @example
|
14 | *
|
15 | * import Component from '@ember/component';
|
16 | * import { buildWaiter } from '@ember/test-waiters';
|
17 | *
|
18 | * if (DEBUG) {
|
19 | * let waiter = buildWaiter('friend-waiter');
|
20 | * }
|
21 | *
|
22 | * export default class Friendz extends Component {
|
23 | * didInsertElement() {
|
24 | * let token = waiter.beginAsync(this);
|
25 | *
|
26 | * someAsyncWork().then(() => {
|
27 | * waiter.endAsync(token);
|
28 | * });
|
29 | * }
|
30 | * }
|
31 | */
|
32 | export default function buildWaiter(name: string): TestWaiter;
|