File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ description: |
6
6
defines: [asyncTest]
7
7
---*/
8
8
9
+ /**
10
+ * Defines the **sole** asynchronous test of a file.
11
+ * @see {@link ../docs/rfcs/async-helpers.md } for background.
12
+ *
13
+ * @param {Function } testFunc a callback whose returned promise indicates test results
14
+ * (fulfillment for success, rejection for failure)
15
+ * @returns {void }
16
+ */
9
17
function asyncTest ( testFunc ) {
10
18
if ( ! Object . hasOwn ( globalThis , "$DONE" ) ) {
11
19
throw new Test262Error ( "asyncTest called without async flag" ) ;
@@ -28,6 +36,18 @@ function asyncTest(testFunc) {
28
36
}
29
37
}
30
38
39
+ /**
40
+ * Asserts that a callback asynchronously throws an instance of a particular
41
+ * error (i.e., returns a promise whose rejection value is an object referencing
42
+ * the constructor).
43
+ *
44
+ * @param {Function } expectedErrorConstructor the expected constructor of the
45
+ * rejection value
46
+ * @param {Function } func the callback
47
+ * @param {string } [message] the prefix to use for failure messages
48
+ * @returns {Promise<void> } fulfills if the expected error is thrown,
49
+ * otherwise rejects
50
+ */
31
51
assert . throwsAsync = function ( expectedErrorConstructor , func , message ) {
32
52
return new Promise ( function ( resolve ) {
33
53
var innerThenable ;
You can’t perform that action at this time.
0 commit comments