donjewey
donjewey

Reputation: 23

Using cross-env-shell to run psql [npm script]

My scripts:

"test": "cross-env NODE_ENV=test && npm run wipeTestDB && jest -c ./jest.unit.json",
"wipeTestDB": "cross-env-shell \"psql -d $PG_TEST_URI -f server/scripts/DB.sql\""

I am getting a pSQL error when I run npm test, but when I have the dB URI written in the script, it runs fine.

My .env file is in the root dir, and trying a script to echo the URI also doesn't work.

What am I doing wrong?

Upvotes: 1

Views: 498

Answers (0)

Related Questions