I am having trouble figuring out why is npm
taking .
without --
delimiter.
In the following command .
is passed to test
script without --
delimiter.
npm test .
test
script is defined in package.json
like this:
"test": "react-app-rewired test"
Passing regular argument to test
script
This happened to me when I tried to pass --coverage
to npm test
but later i found out that to pass arguments to npm script i need --
before any following argument.
This is what works if i want to pass argument:
npm test -- --coverage
But this is will not pass --coverage
argument
npm test --coverage
Question is why is .
being passed without --
. Based on npm documentation to pass any argument to a script we need to use --
delimiter and npm will know that the following flags/arguments are for test
script or any other script that we want to parametrize.
.
is an option fornpm
command? But in my case it is also a parameter for test command that is wrapped bynpm test
– Intendment.
) is not interpreted as an option because it does not begin with a hyphen (-
). – Aikoailnpm test somethinElse
and it ran likereact-app-rewired test somethingElse
. – Intendment