Skip to content

Commit

Permalink
Add fix for handling Jest fake timers
Browse files Browse the repository at this point in the history
  • Loading branch information
slightlytyler committed Apr 5, 2018
1 parent 9c52efd commit ae2a21b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
@@ -1,4 +1,7 @@
{
"globals": {
"window": true
},
"parser": "typescript-eslint-parser",
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"plugins": ["import", "typescript", "prettier"],
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
@@ -1,3 +1,7 @@
// Used to avoid using Jest's fake timers.
// See https://github.com/TheBrainFamily/wait-for-expect/issues/4 for more info
const { setTimeout } = typeof window !== "undefined" ? window : global;

/**
* Waits for the expectation to pass and returns a Promise
*
Expand Down

0 comments on commit ae2a21b

Please sign in to comment.