Skip to content

Commit 1d56525

Browse files
Fix integration tests for Windows (#16693)
The Nuxt preview server always starts on port 3000 even if that port is taken. With the added tests in #16631 there is now a higher chance these ports are already taken since e.g. react router prefers to start at port 3000 and so do other servers. This PR changes this so that we assign a random port inside the test instead. ## Test plan - Ensure Windows CI is green again
1 parent 3f270d2 commit 1d56525

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

integrations/vite/nuxt.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ test('dev mode', SETUP, async ({ fs, spawn, expect }) => {
7676

7777
test('build', SETUP, async ({ spawn, exec, expect }) => {
7878
await exec('pnpm nuxt build')
79-
let process = await spawn('pnpm nuxt preview', {
79+
// The Nuxt preview server does not automatically assign a free port if 3000
80+
// is taken, so we use a random port instead.
81+
let process = await spawn(`pnpm nuxt preview --port 8724`, {
8082
env: {
8183
TEST: 'false',
8284
NODE_ENV: 'development',

0 commit comments

Comments
 (0)