Skip to content

Commit

Permalink
fix(server): Maintain a private reference to the global setTimeout
Browse files Browse the repository at this point in the history
…function in case that function is mocked in a consumer test (e.g. `sinon.useFakeTimers()`) (#110)
  • Loading branch information
Cody Jenkins authored and TimothyJones committed Aug 2, 2019
1 parent 96bc918 commit f4ebfff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {ChildProcess} from "child_process";
const mkdirp = require("mkdirp");
const checkTypes = require("check-types");

// Get a reference to the global setTimeout object in case it is mocked by a testing library later
const setTimeout = global.setTimeout;

const CHECKTIME = 500;
const RETRY_AMOUNT = 60;
const PROCESS_TIMEOUT = 30000;
Expand Down

0 comments on commit f4ebfff

Please sign in to comment.