Skip to content

Commit

Permalink
Add getVmContext and clean up vm context in teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
lh0x00 committed Feb 21, 2020
1 parent 2f7b6d1 commit 7ff4bfc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/jest-environment-jsdom/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class JSDOMEnvironment implements JestEnvironment {
// @ts-ignore
this.global = null;
this.dom = null;
this.vm = null;
this.fakeTimers = null;
this.fakeTimersLolex = null;
}
Expand All @@ -135,8 +136,13 @@ class JSDOMEnvironment implements JestEnvironment {
if (this.vm) {
return script.runInContext(this.vm);
}

return null;
}

getVmContext() {
return this.vm;
}
}

export = JSDOMEnvironment;

0 comments on commit 7ff4bfc

Please sign in to comment.