mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
feat: update with-ava example
This commit is contained in:
parent
50ade95694
commit
d2a57bc329
@ -11,6 +11,6 @@
|
||||
"jsdom": "^11.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"nuxt": "^1.0.0-alpha2"
|
||||
"nuxt": "latest"
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
import test from 'ava'
|
||||
import Nuxt from 'nuxt'
|
||||
import { Nuxt, Builder } from 'nuxt'
|
||||
import { resolve } from 'path'
|
||||
|
||||
// We keep the nuxt and server instance
|
||||
// So we can close them at the end of the test
|
||||
let nuxt = null
|
||||
let server = null
|
||||
|
||||
// Init Nuxt.js and create a server listening on localhost:4000
|
||||
test.before('Init Nuxt.js', async t => {
|
||||
@ -15,9 +14,8 @@ test.before('Init Nuxt.js', async t => {
|
||||
config.rootDir = rootDir // project folder
|
||||
config.dev = false // production build
|
||||
nuxt = new Nuxt(config)
|
||||
await nuxt.build()
|
||||
server = new nuxt.Server(nuxt)
|
||||
server.listen(4000, 'localhost')
|
||||
await new Builder(nuxt).build()
|
||||
await nuxt.listen(4000, 'localhost')
|
||||
})
|
||||
|
||||
// Example of testing only generated html
|
||||
@ -39,6 +37,5 @@ test('Route / exits and render HTML with CSS applied', async t => {
|
||||
|
||||
// Close server and ask nuxt to stop listening to file changes
|
||||
test.after('Closing server and nuxt.js', t => {
|
||||
server.close()
|
||||
nuxt.close()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user