-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4353d06
commit 83b189b
Showing
17 changed files
with
35 additions
and
41 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
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,7 +1,7 @@ | ||
import test from '../../'; | ||
|
||
test(t => { | ||
var circular = ['a', 'b']; | ||
const circular = ['a', 'b']; | ||
circular.push(circular); | ||
t.same([circular, 'c'], [circular, 'd']); | ||
}); |
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
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
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
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,10 +1,9 @@ | ||
const test = require('../../'); | ||
import test from '../../'; | ||
|
||
test.before(pass); | ||
test.beforeEach(pass); | ||
test.after(pass); | ||
test.afterEach(pass); | ||
test(pass); | ||
|
||
function pass(t) { | ||
} | ||
function 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 |
---|---|---|
|
@@ -2,5 +2,4 @@ import test from '../../../../'; | |
|
||
test(t => { | ||
t.pass(); | ||
t.end(); | ||
}); |
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 |
---|---|---|
|
@@ -2,5 +2,4 @@ import test from '../../../../'; | |
|
||
test(t => { | ||
t.pass(); | ||
t.end(); | ||
}); |
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,30 +1,31 @@ | ||
'use strict'; | ||
const test = require('../../'); | ||
var onExit = require('signal-exit'); | ||
import test from '../../'; | ||
import signalExit from 'signal-exit'; | ||
|
||
test.cb('long running', function (t) { | ||
test.cb('long running', t => { | ||
t.plan(1); | ||
|
||
onExit(function () { | ||
signalExit(() => { | ||
// simulate an exit hook that lasts a short while | ||
var start = Date.now(); | ||
while(Date.now() - start < 2000) { | ||
//synchronously wait for 2 seconds | ||
const start = Date.now(); | ||
|
||
while (Date.now() - start < 2000) { | ||
// synchronously wait for 2 seconds | ||
} | ||
|
||
process.send({ | ||
name: 'cleanup-completed', | ||
data: {completed: true}, | ||
ava: true | ||
}); | ||
}, {alwaysLast: true}); | ||
|
||
setTimeout(function () { | ||
setTimeout(() => { | ||
t.ok(true); | ||
t.end(); | ||
}); | ||
|
||
setTimeout(function () { | ||
// this would keep the process running for a long time. | ||
setTimeout(() => { | ||
// this would keep the process running for a long time | ||
console.log('I\'m gonna live forever!!'); | ||
}, 15000); | ||
}); |
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,9 +1,9 @@ | ||
const test = require('../../'); | ||
import test from '../../'; | ||
|
||
test.cb('creates an unhandled rejection', t => { | ||
Promise.reject(new Error(`You can't handle this!`)); | ||
|
||
setTimeout(function () { | ||
setTimeout(() => { | ||
t.end(); | ||
}); | ||
}); |
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,4 +1,4 @@ | ||
const test = require('../../'); | ||
import test from '../../'; | ||
|
||
test('this is a passing test', t => { | ||
t.ok(true); | ||
|
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
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
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
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,7 +1,7 @@ | ||
const test = require('../../'); | ||
import test from '../../'; | ||
|
||
test('throw an uncaught exception', t => { | ||
test('throw an uncaught exception', () => { | ||
setImmediate(() => { | ||
throw function () {}; | ||
throw () => {}; | ||
}); | ||
}); |
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,9 +1,9 @@ | ||
const test = require('../../'); | ||
import test from '../../'; | ||
|
||
function fooFn() {} | ||
|
||
test('throw an uncaught exception', t => { | ||
test('throw an uncaught exception', () => { | ||
setImmediate(() => { | ||
throw fooFn | ||
throw fooFn; | ||
}); | ||
}); |
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,7 +1,7 @@ | ||
const test = require('../../'); | ||
import test from '../../'; | ||
|
||
test('throw an uncaught exception', t => { | ||
test('throw an uncaught exception', () => { | ||
setImmediate(() => { | ||
throw new Error(`Can't catch me!`) | ||
throw new Error(`Can't catch me!`); | ||
}); | ||
}); |