When I run the command npm run test -- -g "transcoder is not already registered" test/unit/BondingManager.js I expect only the it/describe blocks containing "transcoder is not already registered" to run within test/unit/BondingManager.js. However, instead, all it/describe blocks containing "transcoder" are run. It looks like the Mocha RegExp is matching the "transcoder" pattern, but the rest of the string passed to the -g flag are dropped:
> bash scripts/test.sh "-g" "\"transcoder" "is" "not" "already" "registered\"" "test/unit/BondingManager.js"
Starting new ganache instance at port 8545
RegExp: 4: /"transcoder/
I suspect this is due to the use of "$@" in test.sh which I think strips user provided quotes. As a result, "transcoder is not already registered" would not be passed to the -g flag as a quoted string.
When I run the command
npm run test -- -g "transcoder is not already registered" test/unit/BondingManager.js
I expect only the it/describe blocks containing "transcoder is not already registered" to run withintest/unit/BondingManager.js
. However, instead, all it/describe blocks containing "transcoder" are run. It looks like the Mocha RegExp is matching the "transcoder" pattern, but the rest of the string passed to the-g
flag are dropped:I suspect this is due to the use of "$@" in test.sh which I think strips user provided quotes. As a result, "transcoder is not already registered" would not be passed to the
-g
flag as a quoted string.