UNPKG

1.61 kBTypeScriptView Raw
1declare module 'ember-testing/lib/adapters/adapter' {
2 import EmberObject from '@ember/object';
3 /**
4 @module @ember/test
5 */
6 /**
7 The primary purpose of this class is to create hooks that can be implemented
8 by an adapter for various test frameworks.
9
10 @class TestAdapter
11 @public
12 */
13 interface Adapter extends EmberObject {
14 asyncStart(): void;
15 asyncEnd(): void;
16 exception(error: unknown): never;
17 }
18 const Adapter: Readonly<typeof EmberObject> &
19 (new (owner?: import('@ember/owner').default | undefined) => EmberObject) & {
20 /**
21 This callback will be called whenever an async operation is about to start.
22
23 Override this to call your framework's methods that handle async
24 operations.
25
26 @public
27 @method asyncStart
28 */
29 asyncStart(): void;
30 /**
31 This callback will be called whenever an async operation has completed.
32
33 @public
34 @method asyncEnd
35 */
36 asyncEnd(): void;
37 /**
38 Override this method with your testing framework's false assertion.
39 This function is called whenever an exception occurs causing the testing
40 promise to fail.
41
42 QUnit example:
43
44 ```javascript
45 exception: function(error) {
46 ok(false, error);
47 };
48 ```
49
50 @public
51 @method exception
52 @param {String} error The exception to be raised.
53 */
54 exception(error: unknown): never;
55 };
56 export default Adapter;
57}