1
1
mirror of https://github.com/c8r/x0.git synced 2024-08-17 09:20:52 +03:00

Update tests

This commit is contained in:
Brent Jackson 2017-12-07 12:13:48 -05:00
parent 969870ec8b
commit eea30867fc
4 changed files with 29 additions and 32 deletions

View File

@ -41,7 +41,7 @@
},
"devDependencies": {
"@compositor/logo": "^1.2.2",
"ava": "^0.22.0",
"ava": "^0.24.0",
"cxs": "^6.1.0",
"isomorphic-fetch": "^2.2.1",
"nyc": "^11.2.1",

View File

@ -17,9 +17,8 @@ Generated by [AVA](https://ava.li).
> Snapshot 1
`<!DOCTYPE html>
<div id='__APP__'>
<meta charset='utf-8'>
<h1>Hello</h1>
</div>
`
@ -29,9 +28,8 @@ Generated by [AVA](https://ava.li).
> Snapshot 1
`<!DOCTYPE html>
<div id='__APP__'>
<meta charset='utf-8'>
<h1>Hello</h1>
</div>
`
@ -41,9 +39,8 @@ Generated by [AVA](https://ava.li).
> Snapshot 1
`<!DOCTYPE html>
<div id='__APP__'>
<meta charset='utf-8'>
<h1 data-reactroot="">Hello</h1>
</div>
<script id='__initial-props__' type='application/json'>{"outDir":"test/output"}</script>
<script src='/bundle.js'></script>
`

Binary file not shown.

View File

@ -22,32 +22,32 @@ test.before(clean)
test.after(clean)
test.cb('static renders', t => {
x0Static(hello, {}, (err, result) => {
t.is(err, null)
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
x0Static(hello, {})
.then(result => {
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
})
test.cb('static writes', t => {
x0Static(hello, {
outDir: 'test/output'
}, (err, result) => {
t.is(err, null)
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
.then(result => {
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
})
test.cb('static uses getInitialProps method', t => {
x0Static(withprops, {}, (err, result) => {
t.is(err, null)
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
x0Static(withprops, {})
.then(result => {
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
})
test.cb('static picks up routes config', t => {
@ -55,12 +55,12 @@ test.cb('static picks up routes config', t => {
routes: [
'/'
]
}, (err, result) => {
t.is(err, null)
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
.then(result => {
t.is(typeof result, 'object')
t.snapshot(result.html)
t.end()
})
})
test.cb('static makes a directory', t => {
@ -70,8 +70,8 @@ test.cb('static makes a directory', t => {
x0Static(hello, {
outDir: 'test/output'
}, (err, result) => {
t.is(err, null)
t.end()
})
.then(result => {
t.end()
})
})