mirror of
https://github.com/c8r/x0.git
synced 2024-09-11 13:45:52 +03:00
Use async tests
This commit is contained in:
parent
c2f1a63faa
commit
942fd62883
@ -22,40 +22,20 @@ const clean = () => {
|
|||||||
test.before(clean)
|
test.before(clean)
|
||||||
test.after(clean)
|
test.after(clean)
|
||||||
|
|
||||||
test.cb('static renders', t => {
|
test('static renders', async t => {
|
||||||
build(options)
|
const res = await build(options)
|
||||||
.then(result => {
|
const html = fs.readFileSync(htmlFile, 'utf8')
|
||||||
const html = fs.readFileSync(htmlFile, 'utf8')
|
t.snapshot(html)
|
||||||
t.snapshot(html)
|
|
||||||
t.end()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
/*
|
test('static uses getInitialProps method', async t => {
|
||||||
test.cb('static writes', t => {
|
const res = await build(options)
|
||||||
build(options)
|
const html = fs.readFileSync(propsFile, 'utf8')
|
||||||
.then(result => {
|
t.snapshot(html)
|
||||||
t.is(typeof result, 'object')
|
|
||||||
t.snapshot(result.html)
|
|
||||||
t.end()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
test.cb('static uses getInitialProps method', t => {
|
|
||||||
build(options)
|
|
||||||
.then(result => {
|
|
||||||
const html = fs.readFileSync(propsFile, 'utf8')
|
|
||||||
t.snapshot(html)
|
|
||||||
t.end()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test.cb('static makes a directory', t => {
|
test('static makes a directory', async t => {
|
||||||
fs.remove(output)
|
fs.remove(output)
|
||||||
|
const res = await build(options)
|
||||||
build(options)
|
t.pass()
|
||||||
.then(result => {
|
|
||||||
t.end()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user