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
This commit is contained in:
parent
3f270d2d9b
commit
1d56525fa0
1 changed files with 3 additions and 1 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue