-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: add tests for --saveCompiledTests --saveOnlyFailed
- Loading branch information
Showing
16 changed files
with
154 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
test/**/*.{fail,pass} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version": "3.0.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/*--- | ||
description: Async test | ||
expected: | ||
pass: true | ||
flags: [async] | ||
---*/ | ||
|
||
var p = new Promise(function(resolve) { | ||
resolve(); | ||
}); | ||
|
||
p.then($DONE, $DONE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*--- | ||
description: Should test in both modes | ||
negative: | ||
phase: runtime | ||
type: ReferenceError | ||
expected: | ||
pass: true | ||
---*/ | ||
var strict; | ||
try { x = 1; strict = false;} catch(e) { strict = true } | ||
|
||
if(strict) { | ||
y = 1; | ||
} else { | ||
throw new ReferenceError(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/*--- | ||
description: Fails by calling $ERROR | ||
expected: | ||
pass: false | ||
message: failure message | ||
---*/ | ||
|
||
$ERROR('failure message'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/*--- | ||
description: Should report the expected error indicated by the "negative" frontmatter | ||
negative: ExpectedError | ||
expected: | ||
pass: false | ||
---*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/*--- | ||
description: Should not test in strict mode | ||
flags: [noStrict] | ||
expected: | ||
pass: true | ||
---*/ | ||
x = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*--- | ||
description: Should not test in strict mode | ||
flags: [raw] | ||
expected: | ||
pass: true | ||
---*/ | ||
var seemsStrict; | ||
try { | ||
x = 1; | ||
} catch (err) { | ||
seemsStrict = err.constructor === ReferenceError; | ||
} | ||
|
||
if (seemsStrict) { | ||
throw new Error('Script erroneously interpreted in strict mode.'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*--- | ||
description: Should not test in strict mode (but allow strict mode to be enabled) | ||
flags: [raw] | ||
expected: | ||
pass: true | ||
---*/ | ||
'use strict'; | ||
var seemsStrict; | ||
try { | ||
x = 1; | ||
} catch (err) { | ||
seemsStrict = err.constructor === ReferenceError; | ||
} | ||
|
||
if (!seemsStrict) { | ||
throw new Error('Script erroneously not interpreted in strict mode.'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/*--- | ||
description: Should not test in sloppy mode | ||
flags: [onlyStrict] | ||
negative: | ||
phase: runtime | ||
type: ReferenceError | ||
expected: | ||
pass: true | ||
---*/ | ||
x = 5; | ||
$ERROR('Not in strict mode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/*--- | ||
description: Fails by throwing an error | ||
expected: | ||
pass: false | ||
message: "Expected no error, got Error: failure message" | ||
---*/ | ||
|
||
function foo() { | ||
throw new Error('failure message'); | ||
} | ||
|
||
foo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters