fix: temporary fix for running electron tests (#6576)

a workaround for spawn EINVAL error.
Found this issue according to https://github.com/node-red/node-red/pull/4652

~~In our case the electron app is spawned by playwright. I am still investigating the issue but don't know how long it takes.~~

Upstream fix: https://github.com/microsoft/playwright/pull/30382
This commit is contained in:
pengx17 2024-04-16 06:57:17 +00:00
parent a98471daa2
commit ebb38a42a0
No known key found for this signature in database
GPG Key ID: 23F23D9E8B3971ED
3 changed files with 4 additions and 1 deletions

2
.nvmrc
View File

@ -1 +1 @@
20
20.12.1

View File

@ -37,6 +37,7 @@ function spawnOrReloadElectron() {
spawnProcess = spawn(exe, ['.'], {
cwd: electronDir,
env: process.env,
shell: true,
});
spawnProcess.stdout.on('data', d => {

View File

@ -55,12 +55,14 @@ if (!process.env.SKIP_WEB_BUILD) {
stdio: 'inherit',
env: process.env,
cwd,
shell: true,
});
spawnSync('yarn', ['workspace', '@affine/electron', 'build'], {
stdio: 'inherit',
env: process.env,
cwd,
shell: true,
});
// step 1.5: amend sourceMappingURL to allow debugging in devtools