-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
49 lines (39 loc) · 842 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import test from './index.js'
import assert from 'assert'
test('triala', class {
async _timeout (ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
'It should pass' () {
assert.ok('Passing through.')
}
'It should fail' () {
assert.fail('You shall not pass!')
}
async 'It should pass after some time' () {
return new Promise(resolve => {
setTimeout(() => {
resolve()
}, 1000)
})
}
async 'It should fail after some time' () {
await this._timeout(1000)
new Error('Epic timeout fail!')
}
'm It is muted' () {
assert.fail('I cannot speak.')
}
_before () {
console.log(' Before')
}
_after () {
console.log(' After')
}
_beforeEach () {
console.log(' Before each')
}
_afterEach () {
console.log(' After each')
}
})