I have created an npm script to run a single jest test file. To run the file I would type:
> npm start test:1 **/unit-test-filename.test.js
I want to make that even easier and type something like:
> jt unit-test-filename
So I've tried creating a bash script that looks like this:
#!/bin/bash -x npm run test:1 **/$1.test.js
Unfortunately when I try running it it puts a single quote around last parameter and it make it so that npm script can't find the file. I get an output like this:
╰─± jt unit-test-filename + npm run test:1 '**/unit-test-filename.test.js' > email@example.com test:1 /Users/path/to/my/current/dir > cross-env NODE_ENV=dev node ./etc/jest1 "**/unit-test-filename.test.js" Error!! Test file: **/unit-test-filename.test.js doesn't exist.
I've tried escaping the asterisk and tried a number of other things. Is this even possible with bash scripting?