Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Respect jest-process-manager launchOptions inside the subdirectory jest.config.js #499

@ocavue

Description

@ocavue

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions