Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cover": "nyc --reporter=html --reporter=text npm test",
"dependencies": "docker-compose up -d BGLd BGLd-ssl BGLd-username-only",
"lint": "eslint src test",
"test": "NODE_ENV=test mocha $npm_package_options_mocha",
"test": "node test/run-mocha.js",
"testdocker": "docker-compose run --rm sut",
"version": "npm run changelog --future-release=$npm_package_version && git add -A CHANGELOG.md"
},
Expand Down
26 changes: 26 additions & 0 deletions test/run-mocha.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

const path = require('path');
const { spawnSync } = require('child_process');

process.env.NODE_ENV = 'test';

const mochaBin = path.join(__dirname, '..', 'node_modules', 'mocha', 'bin', 'mocha');
const result = spawnSync(process.execPath, [
mochaBin,
'--timeout',
'20000',
'--recursive',
'--require',
'should'
].concat(process.argv.slice(2)), {
cwd: path.join(__dirname, '..'),
env: process.env,
stdio: 'inherit'
});

if (result.error) {
throw result.error;
}

process.exit(result.status === null ? 1 : result.status);