mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-04 00:56:01 +00:00
e2e: overwrite webserver config with env
This commit is contained in:
@@ -2,6 +2,7 @@ import { defineConfig, devices } from "@playwright/test";
|
|||||||
|
|
||||||
const baseUrl = process.env.TEST_URL || "http://localhost:28623";
|
const baseUrl = process.env.TEST_URL || "http://localhost:28623";
|
||||||
const startCommand = process.env.TEST_START_COMMAND || "bun run dev";
|
const startCommand = process.env.TEST_START_COMMAND || "bun run dev";
|
||||||
|
const autoStart = ["1", "true", undefined].includes(process.env.TEST_AUTO_START);
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testMatch: "**/*.e2e-spec.ts",
|
testMatch: "**/*.e2e-spec.ts",
|
||||||
@@ -30,9 +31,11 @@ export default defineConfig({
|
|||||||
use: { ...devices["Desktop Safari"] },
|
use: { ...devices["Desktop Safari"] },
|
||||||
}, */
|
}, */
|
||||||
],
|
],
|
||||||
webServer: {
|
webServer: autoStart
|
||||||
command: startCommand,
|
? {
|
||||||
url: baseUrl,
|
command: startCommand,
|
||||||
reuseExistingServer: !process.env.CI,
|
url: baseUrl,
|
||||||
},
|
reuseExistingServer: !process.env.CI,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user