Commit 9634269
committed
Fix an issue w/ cleaning up global.document.
Except in the most recent versions of node, developers are unable to delete
things from global when running code in a node vm. This means that enzyme is
failing to clean up after itself when temporarily defining global.document for
setState calls.
This papers over the issue by explicitly setting global.document to undefined
before attempting to delete. If the delete succeeds, the undefined value will
be removed.
Relevant jest issue - jestjs/jest#3152
Relevant node pr - nodejs/node#112661 parent bdff1b8 commit 9634269
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
| |||
0 commit comments