https://github.com/playwright-community/jest-playwright#configuration 環境変数`JEST_PLAYWRIGHT_CONFIG`でデフォルト`jest-playwright.config.js`の設定ファイル場所を変更できる。 ## 開発環境 サーバは起動しない。 ``` JEST_PLAYWRIGHT_CONFIG=jest-playwright.dev.config.js jest -c jest.e2e.config.js e2e ``` `jest-playwright.dev.config.js` ```js // 特に設定はしない module.exports = {} ``` ## CI環境 サーバを起動する。 `` ``` jest -c jest.e2e.config.js e2e ``` `jest-playwright.config.js` ```js // テスト前にnpm start 3333ポートにてサーバ起動 module.exports = { serverOptions: { command: 'npm start', port: 3333, }, } ``` ## testEnvironmentOptionsについて [[jest-playwright]]の公式には`testEnvironmentOptions.jest-playwright`でも指定できると書いてある。 ```js module.exports = { preset: 'jest-playwright-preset', testEnvironmentOptions: { 'jest-playwright': { // Options... }, }, } ``` ただ少なくとも`--config`でconfigファイルを`jest.config.js`以外にしたときは動作しなかった。