From 5b17805d86da493f2e977cf8072083a0e299d0d2 Mon Sep 17 00:00:00 2001 From: Kamrul H Shourov Date: Sat, 2 Nov 2024 22:46:34 +0600 Subject: [PATCH] Change NODE_ENV value to full version Many libraries have optimizations built in when the NODE_ENV environment variable is set to production. --- .gitignore | 8 ++++---- package.json | 6 +++--- scripts/run-e2e | 8 ++++---- test/resources/{.env.test => .env.testing} | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename test/resources/{.env.test => .env.testing} (95%) diff --git a/.gitignore b/.gitignore index a3d8243..d6e2d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -41,10 +41,10 @@ lerna-debug.log* .env.test.local .env.production.local .env.local -.env.dev -.env.test -.env.prod -!test/resources/.env.test +.env.development +.env.testing +.env.production +!test/resources/.env.testing # temp directory .temp .tmp diff --git a/package.json b/package.json index ab17c15..ca53228 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,9 @@ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "check-format": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", - "start:dev": "NODE_ENV=dev nest start --watch", - "start:debug": "NODE_ENV=dev nest start --debug --watch", - "start:prod": "NODE_ENV=prod node dist/main", + "start:dev": "NODE_ENV=development nest start --watch", + "start:debug": "NODE_ENV=development nest start --debug --watch", + "start:prod": "NODE_ENV=production node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", diff --git a/scripts/run-e2e b/scripts/run-e2e index caa3b23..19e2b72 100755 --- a/scripts/run-e2e +++ b/scripts/run-e2e @@ -4,9 +4,9 @@ MARKER="\033[32m#\033[0m" # Define paths -ROOT_ENV=".env.test" -TEST_ENV="test/resources/.env.test" -BACKUP_ENV=".env.test.backup" +ROOT_ENV=".env.testing" +TEST_ENV="test/resources/.env.testing" +BACKUP_ENV=".env.testing.backup" POSTGRES_COMPOSE_FILE="test/resources/postgresql.yml" get_env_var() { @@ -75,7 +75,7 @@ done linebreak title "Run migration and the NestJS e2e tests" -export NODE_ENV="test" +export NODE_ENV="testing" yarn run migration:run && yarn run jest --config ./test/jest-e2e.json linebreak diff --git a/test/resources/.env.test b/test/resources/.env.testing similarity index 95% rename from test/resources/.env.test rename to test/resources/.env.testing index 43e39d7..f833b52 100644 --- a/test/resources/.env.test +++ b/test/resources/.env.testing @@ -1,4 +1,4 @@ - App configuration +# App configuration PORT=3000 # Rate Limit