From 1d56525fa0a2d6ffe6debc586ddf4acfa5077057 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Thu, 20 Feb 2025 17:50:50 +0100 Subject: [PATCH] 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 --- integrations/vite/nuxt.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integrations/vite/nuxt.test.ts b/integrations/vite/nuxt.test.ts index 1b834525c..ab14628c7 100644 --- a/integrations/vite/nuxt.test.ts +++ b/integrations/vite/nuxt.test.ts @@ -76,7 +76,9 @@ test('dev mode', SETUP, async ({ fs, spawn, expect }) => { test('build', SETUP, async ({ spawn, exec, expect }) => { await exec('pnpm nuxt build') - let process = await spawn('pnpm nuxt preview', { + // The Nuxt preview server does not automatically assign a free port if 3000 + // is taken, so we use a random port instead. + let process = await spawn(`pnpm nuxt preview --port 8724`, { env: { TEST: 'false', NODE_ENV: 'development',