Skip to content

Commit 5c7314b

Browse files
authored
Run download only once for playwright tests (#432)
Instead of using globalSetup (which runs once per worker), we just download the vscode we want to use in a pre-test script.
1 parent ca6da78 commit 5c7314b

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@
295295
"lint": "biome lint --fix .",
296296
"test": "npm run test:integration && npm run test:playwright",
297297
"test:integration": "vscode-test",
298+
"pretest:playwright": "node ./test/playwright/setup-script.mts",
298299
"test:playwright": "playwright test",
299300
"test:playwright:debug": "playwright test --debug --workers=1 --retries=0 --reporter=list",
300301
"package": "vsce package",

playwright.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export default defineConfig<TestOptions>({
1515
expect: {
1616
timeout: 40_000,
1717
},
18-
globalSetup: "./test/playwright/global-setup.ts",
1918
projects: [
2019
{
2120
name: "VS Code insiders",

test/playwright/global-setup.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/playwright/setup-script.mts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This file is run before all tests are run and is just used to prep
2+
// the environment for the tests. It is run only once regardless of how
3+
// many workers are invoked.
4+
5+
import { downloadAndUnzipVSCode } from "@vscode/test-electron";
6+
7+
await downloadAndUnzipVSCode("insiders");

0 commit comments

Comments
 (0)