From 38a525ba5f70bba51e35c7cae3cb4201cc4ab8b5 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sun, 28 May 2017 17:04:25 -0400 Subject: [PATCH] chore(testing): only use TESTING=1 as the testing flag (#3877) --- package.json | 6 +++--- src/Routers/IAPValidationRouter.js | 2 +- src/defaults.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c68ca999..872d89bb 100644 --- a/package.json +++ b/package.json @@ -70,10 +70,10 @@ "lint": "eslint --cache ./", "build": "babel src/ -d lib/ --copy-files", "pretest": "npm run lint", - "test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 $COVERAGE_OPTION jasmine", - "test:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 jasmine", + "test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 TESTING=1 $COVERAGE_OPTION jasmine", + "test:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 TESTING=1 jasmine", "coverage": "cross-env COVERAGE_OPTION='./node_modules/.bin/nyc' npm test", - "coverage:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 NODE_ENV=test TESTING=1 node ./node_modules/.bin/nyc ./node_modules/jasmine/bin/jasmine.js", + "coverage:win": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 TESTING=1 node ./node_modules/.bin/nyc ./node_modules/jasmine/bin/jasmine.js", "start": "node ./bin/parse-server", "prepublish": "npm run build" }, diff --git a/src/Routers/IAPValidationRouter.js b/src/Routers/IAPValidationRouter.js index 24b3c997..565b8707 100644 --- a/src/Routers/IAPValidationRouter.js +++ b/src/Routers/IAPValidationRouter.js @@ -75,7 +75,7 @@ export class IAPValidationRouter extends PromiseRouter { } } - if (process.env.NODE_ENV == "test" && req.body.bypassAppStoreValidation) { + if (process.env.TESTING == "1" && req.body.bypassAppStoreValidation) { return getFileForProductIdentifier(productIdentifier, req); } diff --git a/src/defaults.js b/src/defaults.js index 7be96a45..1b519617 100644 --- a/src/defaults.js +++ b/src/defaults.js @@ -2,7 +2,7 @@ import {nullParser} from './cli/utils/parsers'; const logsFolder = (() => { let folder = './logs/'; - if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') { + if (typeof process !== 'undefined' && process.env.TESTING === '1') { folder = './test_logs/' } if (process.env.PARSE_SERVER_LOGS_FOLDER) {