mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
test: remove debug test
This commit is contained in:
parent
8097d9af00
commit
c7cb0ea562
3
test/fixtures/debug/debug.test.js
vendored
3
test/fixtures/debug/debug.test.js
vendored
@ -1,3 +0,0 @@
|
|||||||
const { buildFixture } = require('../../utils/build')
|
|
||||||
|
|
||||||
buildFixture('debug')
|
|
10
test/fixtures/debug/nuxt.config.js
vendored
10
test/fixtures/debug/nuxt.config.js
vendored
@ -1,10 +0,0 @@
|
|||||||
export default {
|
|
||||||
router: {
|
|
||||||
base: '/test/'
|
|
||||||
},
|
|
||||||
dev: true, // Needed for __open-in-editor middleware
|
|
||||||
debug: true,
|
|
||||||
env: {
|
|
||||||
'NODE_ENV': 'development'
|
|
||||||
}
|
|
||||||
}
|
|
12
test/fixtures/debug/pages/error.vue
vendored
12
test/fixtures/debug/pages/error.vue
vendored
@ -1,12 +0,0 @@
|
|||||||
<template>
|
|
||||||
<h1>Error page</h1>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
/* eslint no-undef: 0 */
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
throw new Error('test youch !')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
0
test/fixtures/debug/pages/index.vue
vendored
0
test/fixtures/debug/pages/index.vue
vendored
@ -1,95 +0,0 @@
|
|||||||
import { loadFixture, getPort, Nuxt, rp } from '../utils'
|
|
||||||
|
|
||||||
let port
|
|
||||||
const url = route => 'http://localhost:' + port + route
|
|
||||||
|
|
||||||
let nuxt = null
|
|
||||||
|
|
||||||
describe.skip('debug', () => {
|
|
||||||
beforeAll(async () => {
|
|
||||||
const config = loadFixture('debug')
|
|
||||||
nuxt = new Nuxt(config)
|
|
||||||
port = await getPort()
|
|
||||||
await nuxt.listen(port, 'localhost')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('/test/__open-in-editor (open-in-editor)', async () => {
|
|
||||||
const { body } = await rp(
|
|
||||||
url('/test/__open-in-editor?file=pages/index.vue'),
|
|
||||||
{ resolveWithFullResponse: true }
|
|
||||||
)
|
|
||||||
expect(body).toBe('')
|
|
||||||
})
|
|
||||||
|
|
||||||
test(
|
|
||||||
'/test/__open-in-editor should return error (open-in-editor)',
|
|
||||||
async () => {
|
|
||||||
await expect(rp(url('/test/__open-in-editor?file='))).rejects.toMatchObject({
|
|
||||||
statusCode: 500,
|
|
||||||
message: 'launch-editor-middleware: required query param "file" is missing.'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
test('/test/error should return error stack trace (Youch)', async () => {
|
|
||||||
// const errorSpy = await interceptError()
|
|
||||||
|
|
||||||
await expect(nuxt.renderAndGetWindow(url('/test/error'))).rejects.toMatchObject({
|
|
||||||
response: {
|
|
||||||
statusCode: 500,
|
|
||||||
statusMessage: 'NuxtServerError'
|
|
||||||
},
|
|
||||||
error: expect.stringContaining('test youch !')
|
|
||||||
})
|
|
||||||
|
|
||||||
// release()
|
|
||||||
// expect(errorSpy.calledTwice).toBe(true)
|
|
||||||
// expect(errorSpy.getCall(0).args[0].includes('test youch !')).toBe(true)
|
|
||||||
// expect(errorSpy.getCall(1).args[0].message.includes('test youch !')).toBe(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('/test/error no source-map (Youch)', async () => {
|
|
||||||
const sourceMaps = nuxt.renderer.resources.serverBundle.maps
|
|
||||||
nuxt.renderer.resources.serverBundle.maps = {}
|
|
||||||
|
|
||||||
// const errorSpy = await interceptError()
|
|
||||||
await expect(nuxt.renderAndGetWindow(url('/test/error'))).rejects.toMatchObject({
|
|
||||||
statusCode: 500,
|
|
||||||
error: expect.stringContaining('<div class="error-frames">')
|
|
||||||
})
|
|
||||||
// release()
|
|
||||||
// expect(errorSpy.calledTwice).toBe(true)
|
|
||||||
// expect(errorSpy.getCall(0).args[0].includes('test youch !')).toBe(true)
|
|
||||||
// expect(errorSpy.getCall(1).args[0].message.includes('test youch !')).toBe(true)
|
|
||||||
|
|
||||||
nuxt.renderer.resources.serverBundle.maps = sourceMaps
|
|
||||||
})
|
|
||||||
|
|
||||||
test('/test/error should return json format error (Youch)', async () => {
|
|
||||||
const opts = {
|
|
||||||
headers: {
|
|
||||||
accept: 'application/json'
|
|
||||||
},
|
|
||||||
resolveWithFullResponse: true
|
|
||||||
}
|
|
||||||
// const errorSpy = await interceptError()
|
|
||||||
|
|
||||||
await expect(rp(url('/test/error'), opts)).rejects.toMatchObject({
|
|
||||||
response: {
|
|
||||||
headers: {
|
|
||||||
'content-type': 'text/json; charset=utf-8'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// release()
|
|
||||||
// expect(errorSpy.calledTwice).toBe(true)
|
|
||||||
// expect(errorSpy.getCall(0).args[0].includes('test youch !')).toBe(true)
|
|
||||||
// expect(errorSpy.getCall(1).args[0].message.includes('test youch !')).toBe(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Close server and ask nuxt to stop listening to file changes
|
|
||||||
afterAll(async () => {
|
|
||||||
await nuxt.close()
|
|
||||||
})
|
|
||||||
})
|
|
Loading…
Reference in New Issue
Block a user