-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test case demonstrating odd teardown timing
Re #353
- Loading branch information
Showing
10 changed files
with
343 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step1 teardown | ||
############## step2 startup | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step2 teardown | ||
############## step3 startup | ||
############## step4 startup | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step3 teardown | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step4 teardown | ||
1..4 | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|
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,28 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
# Subtest: step1 | ||
1..0 | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step2 startup | ||
############## step1 teardown | ||
# Subtest: step2 | ||
1..0 | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 startup | ||
# Subtest: step3 | ||
1..0 | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 teardown | ||
############## step4 startup | ||
# Subtest: step4 | ||
1..0 | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step4 teardown | ||
############## step2 teardown | ||
1..4 | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|
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,28 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step1 teardown | ||
############## step2 startup | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step2 teardown | ||
############## step3 startup | ||
############## step4 startup | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step3 teardown | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step4 teardown | ||
1..4 | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|
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,32 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step1 teardown | ||
############## step2 startup | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step2 teardown | ||
############## step3 startup | ||
############## step4 startup | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step3 teardown | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step4 teardown | ||
not ok 5 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":7},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
Bail out! # ############## step1 teardown | ||
|
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,31 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
# Subtest: step1 | ||
1..0 | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step2 startup | ||
############## step1 teardown | ||
# Subtest: step2 | ||
1..0 | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 startup | ||
# Subtest: step3 | ||
1..0 | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 teardown | ||
############## step4 startup | ||
# Subtest: step4 | ||
1..0 | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step4 teardown | ||
not ok 5 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":7},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
Bail out! # ############## step1 teardown | ||
|
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,49 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step1 teardown | ||
############## step2 startup | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step2 teardown | ||
############## step3 startup | ||
############## step4 startup | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step3 teardown | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ { | ||
1..0 | ||
} | ||
|
||
############## step4 teardown | ||
not ok 5 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":7},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
not ok 6 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":16},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
not ok 7 - ############## step3 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":25},"source":"throw new Error('############## step3 teardown')\n","test":"TAP"} | ||
... | ||
|
||
not ok 8 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":34},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
1..8 | ||
# failed 4 of 8 tests | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|
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,37 @@ | ||
var t = require('../..') | ||
|
||
t.test('step1', function (t) { | ||
console.log('##############', 'step1 startup') | ||
t.tearDown(function () { | ||
console.log('############## step1 teardown') | ||
throw new Error('############## step1 teardown') | ||
}) | ||
setImmediate(t.done) | ||
}) | ||
|
||
t.test('step2', function (t) { | ||
console.log('##############', 'step2 startup') | ||
t.tearDown(function () { | ||
console.log('############## step2 teardown') | ||
throw new Error('############## step1 teardown') | ||
}) | ||
setImmediate(t.done) | ||
}) | ||
|
||
t.test('step3', function (t) { | ||
console.log('##############', 'step3 startup') | ||
t.tearDown(function () { | ||
console.log('############## step3 teardown') | ||
throw new Error('############## step3 teardown') | ||
}) | ||
t.done() | ||
}) | ||
|
||
t.test('step4', function (t) { | ||
console.log('##############', 'step4 startup') | ||
t.tearDown(function () { | ||
console.log('############## step4 teardown') | ||
throw new Error('############## step1 teardown') | ||
}) | ||
t.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,49 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
# Subtest: step1 | ||
1..0 | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step2 startup | ||
############## step1 teardown | ||
# Subtest: step2 | ||
1..0 | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 startup | ||
# Subtest: step3 | ||
1..0 | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 teardown | ||
############## step4 startup | ||
# Subtest: step4 | ||
1..0 | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step4 teardown | ||
not ok 5 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":7},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
not ok 6 - ############## step3 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":25},"source":"throw new Error('############## step3 teardown')\n","test":"TAP"} | ||
... | ||
|
||
not ok 7 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":34},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
############## step2 teardown | ||
not ok 8 - ############## step1 teardown | ||
--- | ||
{"at":{"column":11,"file":"test/test/teardown-timing-throws.js","line":16},"source":"throw new Error('############## step1 teardown')\n","test":"TAP"} | ||
... | ||
|
||
1..8 | ||
# failed 4 of 8 tests | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|
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,33 @@ | ||
var t = require('../..') | ||
|
||
t.test('step1', function (t) { | ||
console.log('##############', 'step1 startup') | ||
t.tearDown(function () { | ||
console.log('##############', 'step1 teardown') | ||
}) | ||
setImmediate(t.done) | ||
}) | ||
|
||
t.test('step2', function (t) { | ||
console.log('##############', 'step2 startup') | ||
t.tearDown(function () { | ||
console.log('##############', 'step2 teardown') | ||
}) | ||
setImmediate(t.done) | ||
}) | ||
|
||
t.test('step3', function (t) { | ||
console.log('##############', 'step3 startup') | ||
t.tearDown(function () { | ||
console.log('##############', 'step3 teardown') | ||
}) | ||
t.done() | ||
}) | ||
|
||
t.test('step4', function (t) { | ||
console.log('##############', 'step4 startup') | ||
t.tearDown(function () { | ||
console.log('##############', 'step4 teardown') | ||
}) | ||
t.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,28 @@ | ||
TAP version 13 | ||
############## step1 startup | ||
# Subtest: step1 | ||
1..0 | ||
ok 1 - step1 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step2 startup | ||
############## step1 teardown | ||
# Subtest: step2 | ||
1..0 | ||
ok 2 - step2 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 startup | ||
# Subtest: step3 | ||
1..0 | ||
ok 3 - step3 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step3 teardown | ||
############## step4 startup | ||
# Subtest: step4 | ||
1..0 | ||
ok 4 - step4 ___/# time=[0-9.]+(ms)?/~~~ | ||
|
||
############## step4 teardown | ||
############## step2 teardown | ||
1..4 | ||
___/# time=[0-9.]+(ms)?/~~~ | ||
|