I am trying to switch my environment on testing and migrate to a new database when running my test cases but I am getting the following error. I am using docker compose to build the image
'ENV' is not recognized as an internal or external command,
I have a .env file with different values in it.
Here is my package.json
{
"name": "storefront_backend",
"version": "0.1.0",
"description": "",
"main": "server.ts",
"scripts": {
"build": "tsc --build",
"start": "tsc --build && ts-node src/server.ts",
"watch": "tsc-watch --esModuleInterop src/server.ts --outDir ./dist --onSuccess \"node ./dist/server.js\"",
"test": "ENV=test && npx tsc && db-migrate --env test up && mocha ./src/spec/*.js && db-migrate db:drop test",
"tsc": "tsc",
"lint": "eslint --fix --ext .ts ."
},
"author": "Udacity",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"db-migrate": "^0.11.13",
"db-migrate-pg": "^1.2.2",
"dotenv": "^16.0.1",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
"pg": "^8.5.1",
"typescript": "^4.1.3"
},
"devDependencies": {
"@types/chai": "^4.3.1",
"@types/express": "^4.17.9",
"@types/jasmine": "^3.10.6",
"@types/mocha": "^9.1.1",
"@types/node": "^17.0.35",
"@types/pg": "^7.14.7",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.26.0",
"bcrypt": "^5.0.1",
"chai": "^4.3.6",
"chai-http": "^4.3.0",
"eslint": "^8.16.0",
"jasmine": "^3.6.4",
"jasmine-spec-reporter": "^6.0.0",
"jasmine-ts": "^0.3.0",
"jest": "^28.1.0",
"mocha": "^10.0.0",
"request": "^2.88.2",
"supertest": "^6.2.3",
"ts-node": "^9.1.1",
"tsc-watch": "^4.2.9"
}
}