Skip to content

chore: fix URL must be file:// protocol error in e2e tests #1331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion examples/app-bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "bun test"
},
"dependencies": {
"nuxt": "^3.17.5"
"nuxt": "catalog:"
},
"devDependencies": {
"@nuxt/test-utils": "latest",
Expand Down
4 changes: 2 additions & 2 deletions examples/app-bun/test/browser.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { describe, it, expect } from 'bun:test'
import { createPage, setup } from '@nuxt/test-utils/e2e'
import { isWindows } from 'std-env'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
browser: true,
})

Expand Down
4 changes: 2 additions & 2 deletions examples/app-bun/test/dev.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { describe, it, expect } from 'bun:test'
import { $fetch, setup } from '@nuxt/test-utils/e2e'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
dev: true,
})

Expand Down
5 changes: 3 additions & 2 deletions examples/app-bun/test/server.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { describe, it, expect } from 'bun:test'
import { $fetch, setup } from '@nuxt/test-utils/e2e'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
server: true,
})

describe('app', () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/app-cucumber/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "NODE_OPTIONS='--loader ts-node/esm' NODE_ENV=test cucumber-js"
},
"dependencies": {
"nuxt": "^3.17.5"
"nuxt": "catalog:"
},
"devDependencies": {
"@cucumber/cucumber": "11.3.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/app-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js"
},
"dependencies": {
"nuxt": "^3.17.5"
"nuxt": "catalog:"
},
"devDependencies": {
"@nuxt/test-utils": "latest",
Expand Down
4 changes: 2 additions & 2 deletions examples/app-jest/test/browser.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { createPage, setup } from '@nuxt/test-utils/e2e'
import { isWindows } from 'std-env'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
browser: true,
})

Expand Down
4 changes: 2 additions & 2 deletions examples/app-jest/test/dev.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { $fetch, setup } from '@nuxt/test-utils/e2e'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
dev: true,
})

Expand Down
5 changes: 3 additions & 2 deletions examples/app-jest/test/server.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { $fetch, setup } from '@nuxt/test-utils/e2e'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
server: true,
})

describe('app', () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/app-playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "playwright test"
},
"dependencies": {
"nuxt": "^3.17.5"
"nuxt": "catalog:"
},
"devDependencies": {
"@nuxt/test-utils": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/app-vitest-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@nuxt/test-utils": "latest",
"@vitest/browser": "3.2.3",
"@vue/test-utils": "2.4.6",
"nuxt": "3.17.5",
"nuxt": "catalog:",
"typescript": "5.8.3",
"vitest": "3.2.3",
"vitest-browser-vue": "0.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/app-vitest-full/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"happy-dom": "18.0.1",
"jsdom": "26.1.0",
"listhen": "1.9.0",
"nuxt": "3.17.5",
"nuxt": "catalog:",
"typescript": "5.8.3",
"vitest": "3.2.3",
"vue-tsc": "2.2.10"
Expand Down
2 changes: 1 addition & 1 deletion examples/app-vitest-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "vitest run"
},
"dependencies": {
"nuxt": "^3.17.5"
"nuxt": "catalog:"
},
"devDependencies": {
"@nuxt/test-utils": "latest",
Expand Down
2 changes: 1 addition & 1 deletion examples/app-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "vitest run"
},
"dependencies": {
"nuxt": "^3.17.5"
"nuxt": "catalog:"
},
"devDependencies": {
"@nuxt/test-utils": "latest",
Expand Down
4 changes: 2 additions & 2 deletions examples/app-vitest/test/browser.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { createPage, setup } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'
import { isWindows } from 'std-env'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
browser: true,
setupTimeout: isWindows ? 240000 : 120000,
})
Expand Down
3 changes: 1 addition & 2 deletions examples/app-vitest/test/build-false.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { $fetch, setup } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'
import { loadNuxt, buildNuxt } from '@nuxt/kit'

const rootDir = fileURLToPath(new URL('../', import.meta.url))
const rootDir = resolve('../', import.meta.dirname)
const randomId = Math.random().toString(36).slice(2, 8)
const buildDir = resolve(rootDir, '.nuxt', 'test', randomId)
const buildOutput = resolve(buildDir, 'output')
Expand Down
4 changes: 2 additions & 2 deletions examples/app-vitest/test/dev.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'node:path'
import { $fetch, setup } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
dev: true,
})

Expand Down
5 changes: 2 additions & 3 deletions examples/app-vitest/test/generate.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { fileURLToPath } from 'node:url'
import { resolve } from 'pathe'
import { resolve } from 'node:path'
import { glob } from 'tinyglobby'
import { setup, useTestContext } from '@nuxt/test-utils/e2e'
import { describe, expect, it } from 'vitest'

await setup({
rootDir: fileURLToPath(new URL('../', import.meta.url)),
rootDir: resolve('../', import.meta.dirname),
nuxtConfig: {
nitro: {
prerender: {
Expand Down
2 changes: 1 addition & 1 deletion examples/content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@nuxt/content": "3.5.1",
"@nuxt/test-utils": "latest",
"@vitest/browser": "3.2.3",
"nuxt": "3.17.5",
"nuxt": "catalog:",
"vitest": "3.2.3",
"vitest-browser-vue": "0.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@nuxt/test-utils": "latest",
"@nuxtjs/i18n": "9.5.4",
"nuxt": "3.17.5",
"nuxt": "catalog:",
"vitest": "3.2.3"
}
}
2 changes: 1 addition & 1 deletion examples/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"devDependencies": {
"@nuxt/module-builder": "1.0.1",
"@nuxt/test-utils": "latest",
"nuxt": "3.17.5",
"nuxt": "catalog:",
"vitest": "3.2.3"
}
}
2 changes: 1 addition & 1 deletion examples/module/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"generate": "nuxi generate"
},
"devDependencies": {
"nuxt": "3.17.5"
"nuxt": "catalog:"
},
"dependencies": {
"vue": "^3.5.15",
Expand Down
36 changes: 21 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ packages:
- "examples/*"
- "examples/module/playground"
- "stubs/*"
catalog:
nuxt: "3.17.5"
2 changes: 1 addition & 1 deletion stubs/vitest-environment-nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"./utils": "./utils.mjs"
},
"dependencies": {
"@nuxt/test-utils": ">=3.15.1"
"@nuxt/test-utils": ">=3.15.3"
}
}