refactor(electron): rename electron.launch()'s args option to launchArguments
Merged
OK
3d ago+23+23+01234567890123456789-22-22-01234567890123456789
electron.launch({ args })is nowelectron.launch({ launchArguments }), the name the target'sapp.launchArgumentsand mobile'sdevice.openApp(app, { launchArguments })already use.- Nothing else changes: the arguments still go after the target's
app.launchArguments, andenv,cwd, andtimeoutkeep their names. electron.launch()is unreleased (#2406,@e2e-dev/electronis0.0.0on npm), so this is not a breaking change. The pending changeset.changeset/electron-per-test-launch.mdis edited in place.- The old key is refused like any unknown option, with
INVALID_ARGUMENT(packages/electron/src/options.ts:147).
await electron.launch({
launchArguments: ['--skip-onboarding'],
env: { APP_DATA_PATH: electron.userDataDir },
});
One difference from mobile stays, for review: on Electron the test's launchArguments are added after the target's, while device.openApp replaces the target's for that launch.
Verified
Ran it locally: yes
- Electron testbed on macOS,
pnpm --filter @e2e-dev/electron-testbed test: 87 of 87 pass, withtests/fixture.e2e.tslaunching the app throughelectron.launch({ launchArguments: ['--per-test'], env })and reading--per-testback fromprocess.argvin the main process, afterapp.restart()too. - Not run: Windows and Linux, which CI covers.
Summary by CodeRabbit
- Changed
- Renamed the per-test
electron.launch()option fromargstolaunchArgumentsacross the API, examples, and migration guidance. Existing validation and launch behavior remain unchanged.
- Renamed the per-test