Unverified Commit 03821625 authored by Ethan Arrowood's avatar Ethan Arrowood Committed by GitHub

Fix playwright config merging for webServer property (#65090)

Fixes:
https://github.com/vercel/next.js/pull/64352#issuecomment-2078963191

Closes NEXT-3238
parent 8eb701c1
...@@ -19,10 +19,17 @@ export function defineConfig<T extends NextOptionsConfig, W>( ...@@ -19,10 +19,17 @@ export function defineConfig<T extends NextOptionsConfig, W>(
export function defineConfig<T extends NextOptionsConfig = NextOptionsConfig>( export function defineConfig<T extends NextOptionsConfig = NextOptionsConfig>(
config: base.PlaywrightTestConfig<T> config: base.PlaywrightTestConfig<T>
): base.PlaywrightTestConfig<T> { ): base.PlaywrightTestConfig<T> {
return base.defineConfig<T>( if (config.webServer !== undefined) {
defaultPlaywrightConfig as base.PlaywrightTestConfig<T>, // Playwright doesn't merge the `webServer` field as we'd expect, so remove our default if the user specifies one.
config const { webServer, ...partialDefaultPlaywrightConfig } =
) defaultPlaywrightConfig as base.PlaywrightTestConfig<T>
return base.defineConfig<T>(partialDefaultPlaywrightConfig, config)
} else {
return base.defineConfig<T>(
defaultPlaywrightConfig as base.PlaywrightTestConfig<T>,
config
)
}
} }
export type { NextFixture, NextOptions } export type { NextFixture, NextOptions }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment