-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
pnpm version: 7
Code to reproduce the issue:
In package.json
:
"scripts": {
"test": "jest"
}
Expected behavior:
As of pnpm@7, pnpm run
forwards CLI arguments without the need for the extra --
separator.
Since pnpm test
really feels like a shortcut for pnpm run test
, both of these commands should, in my opinion, run jest "Foo" "--watchAll"
:
$ pnpm run test Foo --watchAll
jest "Foo" "--watchAll"
$ pnpm test Foo --watchAll
jest "Foo" "--watchAll"
Actual behavior:
$ pnpm test Foo --watchAll
ERROR Unknown option: 'watchAll'
Foo
is a regex filter for Jest. The result is the same if I remove it.
To make it work, I have to pass the --
separator like with pnpm@6:
$ pnpm test -- Foo --watchAll
jest "Foo" "--watchAll"
Note that I can pass the separator after Foo
and Foo
still gets forwarded:
$ pnpm test Foo -- --watchAll
jest "Foo" "--watchAll"
Additional information:
node -v
prints: v16.5.0- Windows, macOS, or Linux?: Linux, but I noticed the same behaviour on Windows too
aomarks, flaggs-kmrmshk, Dremora, vecpeng, raygesualdo and 13 more