Skip to content

Commit

Permalink
jest-environment-node: add atob and btoa
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 27, 2022
1 parent 5f71f86 commit 60f8f49
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/jest-environment-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ class NodeEnvironment implements JestEnvironment<Timer> {
if (typeof performance !== 'undefined') {
global.performance = performance;
}
if (
typeof atob !== 'undefined' &&
typeof btoa !== 'undefined'
) {
global.atob = atob;
global.btoa = btoa;
}
installCommonGlobals(global, config.globals);

this.moduleMocker = new ModuleMocker(global);
Expand Down

0 comments on commit 60f8f49

Please sign in to comment.