Skip to content

Commit

Permalink
Merge pull request #855 from gdborton/fix-global-deletion
Browse files Browse the repository at this point in the history
Fix an issue w/ cleaning up global.document.
  • Loading branch information
gdborton committed Mar 24, 2017
2 parents bdff1b8 + 9634269 commit 67e6384
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ export function withSetStateAllowed(fn) {
}
fn();
if (cleanup) {
// This works around a bug in node/jest in that developers aren't able to
// delete things from global when running in a node vm.
global.document = undefined;
delete global.document;
}
}
Expand Down

0 comments on commit 67e6384

Please sign in to comment.