Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
},
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "^11.0.0",
"@types/node": "^16.11.57",
"@types/node": "^16.11.58",
"@types/rimraf": "^3",
"@unocss/reset": "^0.45.18",
"case-police": "^0.5.10",
"changelogen": "^0.3.0",
"eslint": "^8.23.0",
"eslint-plugin-jsdoc": "^39.3.6",
"execa": "^6.1.0",
"expect-type": "^0.14.0",
"expect-type": "^0.14.2",
"globby": "^13.1.2",
"jiti": "^1.15.0",
"lerna": "^5.5.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"@nuxt/telemetry": "^2.1.5",
"@nuxt/ui-templates": "^0.3.3",
"@nuxt/vite-builder": "3.0.0-rc.9",
"@vue/reactivity": "^3.2.38",
"@vue/shared": "^3.2.38",
"@vue/reactivity": "^3.2.39",
"@vue/shared": "^3.2.39",
"@vueuse/head": "^0.7.9",
"chokidar": "^3.5.3",
"cookie-es": "^0.5.0",
Expand Down Expand Up @@ -66,7 +66,7 @@
"unimport": "^0.6.7",
"unplugin": "^0.9.2",
"untyped": "^0.4.7",
"vue": "^3.2.38",
"vue": "^3.2.39",
"vue-bundle-renderer": "^0.4.2",
"vue-devtools-stub": "^0.1.0",
"vue-router": "^4.1.5"
Expand Down
4 changes: 2 additions & 2 deletions packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"ohmyfetch": "^0.4.18"
},
"devDependencies": {
"playwright": "^1.25.1",
"playwright": "^1.25.2",
"unbuild": "latest",
"vitest": "~0.19.1"
},
"peerDependencies": {
"vue": "^3.2.38"
"vue": "^3.2.39"
},
"engines": {
"node": "^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@nuxt/schema": "3.0.0-rc.9",
"@types/cssnano": "^5",
"unbuild": "latest",
"vue": "3.2.38"
"vue": "3.2.39"
},
"dependencies": {
"@nuxt/kit": "3.0.0-rc.9",
Expand Down Expand Up @@ -54,7 +54,7 @@
"vue-bundle-renderer": "^0.4.2"
},
"peerDependencies": {
"vue": "^3.2.38"
"vue": "^3.2.39"
},
"engines": {
"node": "^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
"@types/webpack-hot-middleware": "^2.25.6",
"@types/webpack-virtual-modules": "^0",
"unbuild": "latest",
"vue": "3.2.38"
"vue": "3.2.39"
},
"peerDependencies": {
"vue": "^3.2.38"
"vue": "^3.2.39"
},
"engines": {
"node": "^14.16.0 || ^16.11.0 || ^17.0.0 || ^18.0.0"
Expand Down
49 changes: 24 additions & 25 deletions test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,30 @@ describe('navigate', () => {
})
})

describe('errors', () => {
it('should render a JSON error page', async () => {
const res = await fetch('/error', {
headers: {
accept: 'application/json'
}
})
expect(res.status).toBe(422)
const error = await res.json()
delete error.stack
expect(error).toMatchObject({
message: 'This is a custom error',
statusCode: 422,
statusMessage: 'This is a custom error',
url: '/error'
})
})

it('should render a HTML error page', async () => {
const res = await fetch('/error')
expect(await res.text()).toContain('This is a custom error')
})
})

describe('navigate external', () => {
it('should redirect to example.com', async () => {
const { headers } = await fetch('/navigate-to-external/', { redirect: 'manual' })
Expand Down Expand Up @@ -570,28 +594,3 @@ describe('useAsyncData', () => {
await expectNoClientErrors('/useAsyncData/promise-all')
})
})

// TODO: Move back up after https://github.com/vuejs/core/issues/6110 is resolved
describe('errors', () => {
it('should render a JSON error page', async () => {
const res = await fetch('/error', {
headers: {
accept: 'application/json'
}
})
expect(res.status).toBe(422)
const error = await res.json()
delete error.stack
expect(error).toMatchObject({
message: 'This is a custom error',
statusCode: 422,
statusMessage: 'This is a custom error',
url: '/error'
})
})

it('should render a HTML error page', async () => {
const res = await fetch('/error')
expect(await res.text()).toContain('This is a custom error')
})
})
Loading