Skip to content

Commit ae09688

Browse files
committed
update deps
1 parent 8e93be7 commit ae09688

5 files changed

+1980
-2058
lines changed

Diff for: jest-env-bundle-browser.js renamed to jest-bundle-browser-env.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
const JSDOMEnvironment = require('jest-environment-jsdom');
1+
const JSDOMEnvironment = require('jest-environment-jsdom').default;
22
const nodeCrypto = require('crypto');
33

44
class CustomJSDOMEnvironment extends JSDOMEnvironment {
5-
constructor(config) {
5+
/*
6+
// doesn't work in jest 28
7+
constructor(config, context) {
68
super({
79
...config,
810
// @see https://github.com/facebook/jest/issues/12586#issuecomment-1073298261
@@ -12,12 +14,16 @@ class CustomJSDOMEnvironment extends JSDOMEnvironment {
1214
Uint8Array,
1315
ArrayBuffer,
1416
},
15-
});
17+
}, context);
1618
}
19+
*/
1720

1821
async setup() {
1922
await super.setup();
2023

24+
this.global.Uint8Array = Uint8Array;
25+
this.global.ArrayBuffer = ArrayBuffer;
26+
2127
// window.crypto is not defined in jsdom
2228
this.global.crypto = {
2329
getRandomValues: function(buffer) {
File renamed without changes.

Diff for: jest-bundle-browser.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ module.exports = {
1212
transformIgnorePatterns: [
1313
'node_modules/(?!(buffer-es6)/)',
1414
],
15-
setupFilesAfterEnv: ["<rootDir>/jest-bundle-setup.js"],
16-
testEnvironment: "<rootDir>/jest-env-bundle-browser.js",
15+
setupFilesAfterEnv: ["<rootDir>/jest-bundle-browser-setup.js"],
16+
testEnvironment: "<rootDir>/jest-bundle-browser-env.js",
1717
};

0 commit comments

Comments
 (0)