From d5e216a5803b5e3564ec36367e355f9d127720e1 Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Sat, 24 Mar 2018 17:11:26 -0500 Subject: [PATCH] Run benchmarks on Windows using SET NODE_ENV=production && npm run bench (Appveyor), and change the way we're making sure that always happens. --- .travis.yml | 3 +++ package.json | 2 +- test/baseline.benchmark.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d4b29b..e819aad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,3 +24,6 @@ branches: notifications: email: - ci@sailsjs.com + +env: + - NODE_ENV=production diff --git a/package.json b/package.json index e6458ca..79f3914 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "custom-tests": "node ./node_modules/mocha/bin/mocha test/*.test.js", "lint": "node ./node_modules/eslint/bin/eslint . --max-warnings=0 --ignore-pattern 'test/' && echo '✔ Your code looks good.'", - "bench": "NODE_ENV=production node ./node_modules/mocha/bin/mocha test/*.benchmark.js", + "bench": "node ./node_modules/mocha/bin/mocha test/*.benchmark.js", "test": "npm run lint && npm run custom-tests && npm run bench" }, "repository": { diff --git a/test/baseline.benchmark.js b/test/baseline.benchmark.js index 043fc8a..2210d4f 100644 --- a/test/baseline.benchmark.js +++ b/test/baseline.benchmark.js @@ -6,6 +6,9 @@ var parley = require('../'); var benchSync = require('./utils/bench-sync.util'); var bench = require('./utils/bench.util'); +if (process.env.NODE_ENV !== 'production') { + throw new Error('Benchmarks should be run with NODE_ENV=production!'); +} /**