mirror of
https://github.com/c8r/x0.git
synced 2024-09-11 13:45:52 +03:00
Update tests
This commit is contained in:
parent
969870ec8b
commit
eea30867fc
@ -41,7 +41,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@compositor/logo": "^1.2.2",
|
"@compositor/logo": "^1.2.2",
|
||||||
"ava": "^0.22.0",
|
"ava": "^0.24.0",
|
||||||
"cxs": "^6.1.0",
|
"cxs": "^6.1.0",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"nyc": "^11.2.1",
|
"nyc": "^11.2.1",
|
||||||
|
@ -17,9 +17,8 @@ Generated by [AVA](https://ava.li).
|
|||||||
> Snapshot 1
|
> Snapshot 1
|
||||||
|
|
||||||
`<!DOCTYPE html>␊
|
`<!DOCTYPE html>␊
|
||||||
<div id='__APP__'>␊
|
<meta charset='utf-8'>␊
|
||||||
<h1>Hello</h1>␊
|
<h1>Hello</h1>␊
|
||||||
</div>␊
|
|
||||||
␊
|
␊
|
||||||
␊
|
␊
|
||||||
`
|
`
|
||||||
@ -29,9 +28,8 @@ Generated by [AVA](https://ava.li).
|
|||||||
> Snapshot 1
|
> Snapshot 1
|
||||||
|
|
||||||
`<!DOCTYPE html>␊
|
`<!DOCTYPE html>␊
|
||||||
<div id='__APP__'>␊
|
<meta charset='utf-8'>␊
|
||||||
<h1>Hello</h1>␊
|
<h1>Hello</h1>␊
|
||||||
</div>␊
|
|
||||||
␊
|
␊
|
||||||
␊
|
␊
|
||||||
`
|
`
|
||||||
@ -41,9 +39,8 @@ Generated by [AVA](https://ava.li).
|
|||||||
> Snapshot 1
|
> Snapshot 1
|
||||||
|
|
||||||
`<!DOCTYPE html>␊
|
`<!DOCTYPE html>␊
|
||||||
<div id='__APP__'>␊
|
<meta charset='utf-8'>␊
|
||||||
<h1 data-reactroot="">Hello</h1>␊
|
<h1 data-reactroot="">Hello</h1>␊
|
||||||
</div>␊
|
|
||||||
<script id='__initial-props__' type='application/json'>{"outDir":"test/output"}</script>␊
|
<script id='__initial-props__' type='application/json'>{"outDir":"test/output"}</script>␊
|
||||||
<script src='/bundle.js'></script>␊
|
<script src='/bundle.js'></script>␊
|
||||||
`
|
`
|
||||||
|
Binary file not shown.
@ -22,32 +22,32 @@ test.before(clean)
|
|||||||
test.after(clean)
|
test.after(clean)
|
||||||
|
|
||||||
test.cb('static renders', t => {
|
test.cb('static renders', t => {
|
||||||
x0Static(hello, {}, (err, result) => {
|
x0Static(hello, {})
|
||||||
t.is(err, null)
|
.then(result => {
|
||||||
t.is(typeof result, 'object')
|
t.is(typeof result, 'object')
|
||||||
t.snapshot(result.html)
|
t.snapshot(result.html)
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test.cb('static writes', t => {
|
test.cb('static writes', t => {
|
||||||
x0Static(hello, {
|
x0Static(hello, {
|
||||||
outDir: 'test/output'
|
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 => {
|
test.cb('static uses getInitialProps method', t => {
|
||||||
x0Static(withprops, {}, (err, result) => {
|
x0Static(withprops, {})
|
||||||
t.is(err, null)
|
.then(result => {
|
||||||
t.is(typeof result, 'object')
|
t.is(typeof result, 'object')
|
||||||
t.snapshot(result.html)
|
t.snapshot(result.html)
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test.cb('static picks up routes config', t => {
|
test.cb('static picks up routes config', t => {
|
||||||
@ -55,12 +55,12 @@ test.cb('static picks up routes config', t => {
|
|||||||
routes: [
|
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 => {
|
test.cb('static makes a directory', t => {
|
||||||
@ -70,8 +70,8 @@ test.cb('static makes a directory', t => {
|
|||||||
|
|
||||||
x0Static(hello, {
|
x0Static(hello, {
|
||||||
outDir: 'test/output'
|
outDir: 'test/output'
|
||||||
}, (err, result) => {
|
|
||||||
t.is(err, null)
|
|
||||||
t.end()
|
|
||||||
})
|
})
|
||||||
|
.then(result => {
|
||||||
|
t.end()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user