Skip to content

Commit

Permalink
Global timeout on bitcore-node
Browse files Browse the repository at this point in the history
  • Loading branch information
micahriggan committed Aug 24, 2020
1 parent 87e61d8 commit b1f120f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/bitcore-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"verify:db": "npm run tsc && node ./build/test/verification/db-verify.js",
"verify:headers": "npm run tsc && node ./build/test/verification/db-verify-headers.js",
"resync": "npm run tsc && node ./build/test/verification/resync.js",
"test:unit": "npm run tsc && mocha build/test/unit/ --recursive --name '*.spec.js' --exit",
"test:integration": "npm run tsc && mocha build/test/integration/ --recursive --name '*.spec.js' --exit",
"benchmark": "npm run tsc && node build/test/benchmark/benchmark.js",
"coverage": "npm run compile && istanbul cover _mocha -- build/test/**/*.spec.js --exit",
"test:unit": "mocha build/test/unit/ --recursive --name '*.spec.js' --exit --timeout 5000",
"test:integration": "mocha build/test/integration/ --recursive --name '*.spec.js' --exit --timeout 5000",
"benchmark": "node build/test/benchmark/benchmark.js",
"coverage": "istanbul cover _mocha -- build/test/**/*.spec.js --exit --timeout 5000",
"api": "npm run tsc && node build/src/workers/api.js",
"api:debug": "npm run tsc && node --inspect build/src/workers/api.js --DEBUG true",
"api:cluster": "npm run tsc && node build/src/workers/api.js --CLUSTER true",
Expand Down
2 changes: 2 additions & 0 deletions packages/bitcore-node/test/helpers/unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { Modules } from '../../src/modules';
let loaded = false;
export async function unitBeforeHelper() {
if (!loaded) {
console.time('Loading Modules');
Modules.loadConfigured();
loaded = true;
console.timeEnd('Loading Modules');
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/bitcore-node/test/unit/logger.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { expect } from 'chai';
import { unitAfterHelper, unitBeforeHelper } from '../helpers/unit';

describe('logger', function() {
before(unitBeforeHelper);
after(unitAfterHelper);

it('should have a test which runs', function() {
expect(true).to.equal(true);
});
Expand Down

0 comments on commit b1f120f

Please sign in to comment.