Skip to content

pnpm run test -- is not handled as a package script when specified in jestCommandLine #974

Open
@ermik

Description

@ermik

Environment

Jest 29 & PNPM 7

Prerequisite

  • are you able to run jest test from the command line? yes
  • how do you run your tests from the command line? pnpm run test

Steps to Reproduce

Set jestCommandLine to pnpm run test -- and use the debug test workflow.

Expected Behavior

The package script will be correctly delegated to for jest binary invocation.

Actual Behavior

The invocation will show node invoking the specified string expecting it to be a path to a module:

[...] /usr/local/bin/node ./pnpm run test

causing "Cannot find module" error. This works with npm run test because usage of a "magic string" (npm) changes the debug invocation to refer to the package manager instead of the local node binary.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions