mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
update tests
This commit is contained in:
parent
0f85308191
commit
d42819ee91
@ -7,7 +7,6 @@ const port = 4001
|
|||||||
const url = (route) => 'http://localhost:' + port + route
|
const url = (route) => 'http://localhost:' + port + route
|
||||||
|
|
||||||
let nuxt = null
|
let nuxt = null
|
||||||
let server = null
|
|
||||||
|
|
||||||
// Init nuxt.js and create server listening on localhost:4000
|
// Init nuxt.js and create server listening on localhost:4000
|
||||||
test.before('Init Nuxt.js', async t => {
|
test.before('Init Nuxt.js', async t => {
|
||||||
@ -38,6 +37,5 @@ test('/_nuxt/test.hot-update.json should returns empty html', async t => {
|
|||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
test.after('Closing server and nuxt.js', async t => {
|
test.after('Closing server and nuxt.js', async t => {
|
||||||
server.close()
|
await nuxt.close()
|
||||||
await nuxt.close(() => {})
|
|
||||||
})
|
})
|
||||||
|
@ -30,7 +30,7 @@ test.before('Init Nuxt.js', async t => {
|
|||||||
server = http.createServer((req, res) => {
|
server = http.createServer((req, res) => {
|
||||||
serve(req, res, finalhandler(req, res))
|
serve(req, res, finalhandler(req, res))
|
||||||
})
|
})
|
||||||
await nuxt.listen(port)
|
server.listen(port)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('/stateless', async t => {
|
test('/stateless', async t => {
|
||||||
|
@ -8,7 +8,6 @@ const port = 4003
|
|||||||
const url = (route) => 'http://localhost:' + port + route
|
const url = (route) => 'http://localhost:' + port + route
|
||||||
|
|
||||||
let nuxt = null
|
let nuxt = null
|
||||||
let server = null
|
|
||||||
|
|
||||||
// Init nuxt.js and create server listening on localhost:4000
|
// Init nuxt.js and create server listening on localhost:4000
|
||||||
test.before('Init Nuxt.js', async t => {
|
test.before('Init Nuxt.js', async t => {
|
||||||
@ -156,6 +155,5 @@ test('ETag Header', async t => {
|
|||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
test.after('Closing server and nuxt.js', t => {
|
test.after('Closing server and nuxt.js', t => {
|
||||||
server.close()
|
|
||||||
nuxt.close()
|
nuxt.close()
|
||||||
})
|
})
|
||||||
|
@ -6,7 +6,6 @@ const port = 4004
|
|||||||
// const url = (route) => 'http://localhost:' + port + route
|
// const url = (route) => 'http://localhost:' + port + route
|
||||||
|
|
||||||
let nuxt = null
|
let nuxt = null
|
||||||
let server = null
|
|
||||||
|
|
||||||
// Init nuxt.js and create server listening on localhost:4000
|
// Init nuxt.js and create server listening on localhost:4000
|
||||||
test.before('Init Nuxt.js', async t => {
|
test.before('Init Nuxt.js', async t => {
|
||||||
@ -57,6 +56,5 @@ test('/parent/validate-child?key=12345', async t => {
|
|||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
test.after('Closing server and nuxt.js', t => {
|
test.after('Closing server and nuxt.js', t => {
|
||||||
server.close()
|
|
||||||
nuxt.close()
|
nuxt.close()
|
||||||
})
|
})
|
||||||
|
@ -6,7 +6,6 @@ const port = 4005
|
|||||||
const url = (route) => 'http://localhost:' + port + route
|
const url = (route) => 'http://localhost:' + port + route
|
||||||
|
|
||||||
let nuxt = null
|
let nuxt = null
|
||||||
let server = null
|
|
||||||
|
|
||||||
// Init nuxt.js and create server listening on localhost:4000
|
// Init nuxt.js and create server listening on localhost:4000
|
||||||
test.before('Init Nuxt.js', async t => {
|
test.before('Init Nuxt.js', async t => {
|
||||||
@ -36,11 +35,11 @@ test('/404 should display an error too', async t => {
|
|||||||
|
|
||||||
test('/ with renderAndGetWindow()', async t => {
|
test('/ with renderAndGetWindow()', async t => {
|
||||||
const err = await t.throws(nuxt.renderAndGetWindow(url('/')))
|
const err = await t.throws(nuxt.renderAndGetWindow(url('/')))
|
||||||
t.is(err.response.statusCode, 500)
|
t.true(String(err).includes('Error: socket hang up'))
|
||||||
|
// t.is(err.response.statusCode, 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
test.after('Closing server and nuxt.js', t => {
|
test.after('Closing server and nuxt.js', t => {
|
||||||
server.close()
|
|
||||||
nuxt.close()
|
nuxt.close()
|
||||||
})
|
})
|
||||||
|
@ -7,7 +7,6 @@ const port = 4006
|
|||||||
const url = (route) => 'http://localhost:' + port + route
|
const url = (route) => 'http://localhost:' + port + route
|
||||||
|
|
||||||
let nuxt = null
|
let nuxt = null
|
||||||
let server = null
|
|
||||||
|
|
||||||
// Init nuxt.js and create server listening on localhost:4000
|
// Init nuxt.js and create server listening on localhost:4000
|
||||||
test.before('Init Nuxt.js', async t => {
|
test.before('Init Nuxt.js', async t => {
|
||||||
@ -40,6 +39,5 @@ test('Middleware', async t => {
|
|||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
test.after('Closing server and nuxt.js', t => {
|
test.after('Closing server and nuxt.js', t => {
|
||||||
server.close()
|
|
||||||
nuxt.close()
|
nuxt.close()
|
||||||
})
|
})
|
||||||
|
@ -7,7 +7,6 @@ const port = 4007
|
|||||||
const url = (route) => 'http://localhost:' + port + route
|
const url = (route) => 'http://localhost:' + port + route
|
||||||
|
|
||||||
let nuxt = null
|
let nuxt = null
|
||||||
let server = null
|
|
||||||
|
|
||||||
// Init nuxt.js and create server listening on localhost:4000
|
// Init nuxt.js and create server listening on localhost:4000
|
||||||
test.before('Init Nuxt.js', async t => {
|
test.before('Init Nuxt.js', async t => {
|
||||||
@ -101,6 +100,5 @@ test('Check /test.txt with custom serve-static options', async t => {
|
|||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
test.after('Closing server and nuxt.js', t => {
|
test.after('Closing server and nuxt.js', t => {
|
||||||
server.close()
|
|
||||||
nuxt.close()
|
nuxt.close()
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user