firebase-tools
firebase-tools copied to clipboard
firebase emulators:exec should pass down the arguments from command line
firebase emulators:exec should pass down the arguments from command line. For example
"scripts": {
"test": "firebase emulators:exec --only firestore --project sample 'jest --runInBand'",
}
If I run
npm run test -- foobar
firebase emulators:exec should take the extra argument (-- foobar) and pass down to jest, like this
firebase emulators:exec --only firestore --project sample 'jest --runInBand -- foobar'
You can still achieve this even if the support is not native. Add a custom ./test.sh bash script with this content
./node_modules/.bin/firebase emulators:exec --project lol "vitest run $*"
and add this script to the package.json
"test": "./test.sh"
Now you can invoke it like this:
pnpm run test --runInBand ./src/my1.test.ts ./src/my2.test.ts
(we are using vitest and pnpm, but it will work the same with other test runners and package managers).
Closing this issue since I am not using Firebase anymore