-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
30 lines (22 loc) · 688 Bytes
/
test.js
File metadata and controls
30 lines (22 loc) · 688 Bytes
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
import test from 'ava'
test.before((t) => {
t.context.log = ''
console.log = (msg) => {
t.context.log += msg
}
})
test.afterEach((t) => {
t.context.log = ''
})
test('calling card.js should contain github url', async (t) => {
await import('./bin/card.js')
t.true(t.context.log.match(/https:\/\/github\.com\/peschee/) !== null)
})
test('calling card.js should contain twitter url', async (t) => {
await import('./bin/card.js')
t.true(t.context.log.match(/https:\/\/twitter\.com\/peschee/) !== null)
})
test('calling card.js should contain card information', async (t) => {
await import('./bin/card.js')
t.true(t.context.log.match(/npx peschee/) !== null)
})