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!'); +} /**