Is your feature request related to a problem? Please describe.
According to this comment, jest-playwright will ignore serverOptions in a sub-package jest configuration. This cause some inconvenience with monorepo.
I created a repository https://github.com/ocavue/jest-playwright-monorepo-example as an example to describe this issue as well as a playground for anyone who wants to fix this issue. There are two sub-packages: my-subpackage-01 and my-subpackage-02 in this repository. I can tell jest to start the dev server for my-subpackage-01 by adding serverOptions inside the root jest-playwright.config.js. But I can't start the dev server for my-subpackage-02 even I added relative command in packages/my-subpackage-02/jest.my-subpackage-02.config.js.
Describe the solution you'd like
Respect the launchOptions configuration inside packages/my-subpackage-02/jest.my-subpackage-02.config.js.
Describe alternatives you've considered
Allow multi jest-process-manager configurations inside launchOptions, like something bellow.
// jest-playwright.config.js
module.exports = {
serverOptions: [
{
command: `yarn workspace my-subpackage-01 dev`,
launchTimeout: 60 * 1000,
debug: true,
port: 3001,
usedPortAction: "error",
},
{
command: `yarn workspace my-subpackage-02 dev`,
launchTimeout: 60 * 1000,
debug: true,
port: 3002,
usedPortAction: "error",
}
]
}
However, by doing this, I can not start the dev server for my-subpackage-02 only when I run tests inside my-subpackage-02. This will bring some limitations like that I can't use the same port for both my packages.
Additional context
N/A