Skip to content
Snippets Groups Projects
Commit 5357b158 authored by Leo Balter's avatar Leo Balter
Browse files

Merge pull request #504 from bocoup/explicit-async

Make asynchronous test configuration explicit
parents b1c979d3 23d56620
No related branches found
No related tags found
No related merge requests found
Showing
with 22 additions and 3 deletions
......@@ -128,6 +128,8 @@ This tag is for boolean properties associated with the test.
- **`raw`** - execute the test without any modification (no helpers will be
available); necessary to test the behavior of directive prologue; implies
`noStrict`
- **`async`** - defer interpretation of test results until after the invocation
of the global $DONE` function
#### features
**features**: [list]
......@@ -198,7 +200,7 @@ assert.throws(ReferenceError, function() {
## Writing Asynchronous Tests
An asynchronous test is any test that includes the string `$DONE` anywhere in the test file. The test runner checks for the presence of this string; if it is found, the runner expects that the `$DONE()` function will be called to signal test completion.
An asynchronous test is any test that include the `async` frontmatter flag. When executing such tests, the runner expects that the global `$DONE()` function will be called to signal test completion.
* If the argument to `$DONE` is omitted, is `undefined`, or is any other falsy value, the test is considered to have passed.
......
......@@ -7,6 +7,7 @@ info: >
es6id: S25.4.3.1_A2.3_T1
author: Sam Mikes
description: Promise.call(resolved Promise) throws TypeError
flags: [async]
---*/
var p = new Promise(function(resolve) { resolve(1); });
......
......@@ -7,6 +7,7 @@ info: >
es6id: S25.4.3.1_A2.4_T1
author: Sam Mikes
description: Promise.call(rejected Promise) throws TypeError
flags: [async]
---*/
var p = new Promise(function(resolve, reject) { reject(1) });
......
......@@ -8,6 +8,7 @@ info: >
es6id: S25.4.3.1_A4.1_T1
author: Sam Mikes
description: new Promise(function () { throw }) should reject
flags: [async]
---*/
var errorObject = {},
......
......@@ -9,7 +9,7 @@ info: >
es6id: S25.4.3.1_A5.1_T1
author: Sam Mikes
description: Promise executor gets default handling for 'this'
flags: [noStrict]
flags: [async, noStrict]
includes: [fnGlobalObject.js]
---*/
......
......@@ -9,7 +9,7 @@ info: >
es6id: S25.4.3.1_A5.1_T2
author: Sam Mikes
description: Promise executor gets default handling for 'this'
flags: [onlyStrict]
flags: [async, onlyStrict]
---*/
var expectedThis = undefined;
......
......@@ -7,6 +7,7 @@ es6id: 25.4.4.1_A2.2_T1
author: Sam Mikes
includes: [PromiseHelper.js]
description: Promise.all([]) returns immediately
flags: [async]
---*/
var sequence = [];
......
......@@ -6,6 +6,7 @@ info: Promise.all([]) returns a promise for a new empty array
es6id: 25.4.4.1_A2.3_T1
author: Sam Mikes
description: Promise.all([]) returns a promise for an array
flags: [async]
---*/
var arg = [];
......
......@@ -6,6 +6,7 @@ info: Promise.all is resolved with a new empty array
es6id: 25.4.4.1_A2.3_T2
author: Sam Mikes
description: Promise.all([]) returns a Promise for an empty array
flags: [async]
---*/
var arg = [];
......
......@@ -6,6 +6,7 @@ info: Promise.all([]) is resolved with Promise for a new empty array
es6id: 25.4.4.1_A2.3_T3
author: Sam Mikes
description: Promise.all([]) is resolved with a Promise for a new array
flags: [async]
---*/
var arg = [];
......
......@@ -9,6 +9,7 @@ info: >
es6id: 25.4.4.1_A3.1_T1
author: Sam Mikes
description: Promise.all(3) returns Promise rejected with TypeError
flags: [async]
---*/
var nonIterable = 3;
......
......@@ -10,6 +10,7 @@ info: >
es6id: S25.4.4.1_A3.1_T2
author: Sam Mikes
description: Promise.all(new Error()) returns Promise rejected with TypeError
flags: [async]
---*/
Promise.all(new Error("abrupt")).then(function () {
......
......@@ -9,6 +9,7 @@ es6id: S25.4.4.1_A3.1_T3
author: Sam Mikes
description: Promise.all((throw on GetIterator)) returns Promise rejected with TypeError
features: [Symbol.iterator]
flags: [async]
---*/
var iterThrows = {};
......
......@@ -9,6 +9,7 @@ es6id: S25.4.4.1_A5.1_T1
author: Sam Mikes
description: iterator.next throws, causing Promise.all to reject
features: [Symbol.iterator]
flags: [async]
---*/
var iterThrows = {};
......
......@@ -8,6 +8,7 @@ info: >
es6id: S25.4.4.1_A6.1_T2
author: Sam Mikes
description: Promise.all([]) returns a promise for an empty array
flags: [async]
---*/
var p = Promise.all([]);
......
......@@ -8,6 +8,7 @@ info: >
es6id: S25.4.4.1_A6.1_T2
author: Sam Mikes
description: Promise.all([p1]) is resolved with a promise for a one-element array
flags: [async]
---*/
var p1 = Promise.resolve(3);
......
......@@ -9,6 +9,7 @@ es6id: S25.4.4.1_A7.2_T1
author: Sam Mikes
description: Promise.all() accepts a one-element array
includes: [PromiseHelper.js]
flags: [async]
---*/
var sequence = [];
......
......@@ -6,6 +6,7 @@ es6id: S25.4.4.1_A8.1_T1
author: Sam Mikes
description: Promise.all([p1, p2]) resolution functions are called in predictable sequence
includes: [PromiseHelper.js]
flags: [async]
---*/
var sequence = [];
......
......@@ -8,6 +8,7 @@ es6id: S25.4.4.1_A8.1_T1
author: Sam Mikes
description: Promise.all() rejects when a promise in its array rejects
includes: [PromiseHelper.js]
flags: [async]
---*/
var rejectP1,
......
......@@ -8,6 +8,7 @@ es6id: S25.4.4.1_A8.2_T2
author: Sam Mikes
description: Promise.all() rejects when second promise in array rejects
includes: [PromiseHelper.js]
flags: [async]
---*/
var rejectP2,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment