jest-environment-jsdom 27.0.2 → 27.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1 -1
- package/build/index.js +9 -3
- package/package.json +8 -8
package/build/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ declare type Win = Window & Global.Global & {
|
|
|
16
16
|
stackTraceLimit: number;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
declare class JSDOMEnvironment implements JestEnvironment {
|
|
19
|
+
declare class JSDOMEnvironment implements JestEnvironment<number> {
|
|
20
20
|
dom: JSDOM | null;
|
|
21
21
|
fakeTimers: LegacyFakeTimers<number> | null;
|
|
22
22
|
fakeTimersModern: ModernFakeTimers | null;
|
package/build/index.js
CHANGED
|
@@ -70,6 +70,12 @@ class JSDOMEnvironment {
|
|
|
70
70
|
|
|
71
71
|
this.dom = new (_jsdom().JSDOM)('<!DOCTYPE html>', {
|
|
72
72
|
pretendToBeVisual: true,
|
|
73
|
+
resources:
|
|
74
|
+
typeof config.testEnvironmentOptions.userAgent === 'string'
|
|
75
|
+
? new (_jsdom().ResourceLoader)({
|
|
76
|
+
userAgent: config.testEnvironmentOptions.userAgent
|
|
77
|
+
})
|
|
78
|
+
: undefined,
|
|
73
79
|
runScripts: 'dangerously',
|
|
74
80
|
url: config.testURL,
|
|
75
81
|
virtualConsole: new (_jsdom().VirtualConsole)().sendTo(
|
|
@@ -88,7 +94,7 @@ class JSDOMEnvironment {
|
|
|
88
94
|
// to see more than that when a test fails.
|
|
89
95
|
|
|
90
96
|
this.global.Error.stackTraceLimit = 100;
|
|
91
|
-
(0, _jestUtil().installCommonGlobals)(global, config.globals); // TODO: remove this ASAP, but it
|
|
97
|
+
(0, _jestUtil().installCommonGlobals)(global, config.globals); // TODO: remove this ASAP, but it currently causes tests to run really slow
|
|
92
98
|
|
|
93
99
|
global.Buffer = Buffer; // Report uncaught errors.
|
|
94
100
|
|
|
@@ -128,13 +134,13 @@ class JSDOMEnvironment {
|
|
|
128
134
|
};
|
|
129
135
|
this.fakeTimers = new (_fakeTimers().LegacyFakeTimers)({
|
|
130
136
|
config,
|
|
131
|
-
global,
|
|
137
|
+
global: global,
|
|
132
138
|
moduleMocker: this.moduleMocker,
|
|
133
139
|
timerConfig
|
|
134
140
|
});
|
|
135
141
|
this.fakeTimersModern = new (_fakeTimers().ModernFakeTimers)({
|
|
136
142
|
config,
|
|
137
|
-
global
|
|
143
|
+
global: global
|
|
138
144
|
});
|
|
139
145
|
}
|
|
140
146
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-environment-jsdom",
|
|
3
|
-
"version": "27.0
|
|
3
|
+
"version": "27.1.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@jest/environment": "^27.0
|
|
18
|
-
"@jest/fake-timers": "^27.0
|
|
19
|
-
"@jest/types": "^27.0
|
|
17
|
+
"@jest/environment": "^27.1.0",
|
|
18
|
+
"@jest/fake-timers": "^27.1.0",
|
|
19
|
+
"@jest/types": "^27.1.0",
|
|
20
20
|
"@types/node": "*",
|
|
21
|
-
"jest-mock": "^27.0
|
|
22
|
-
"jest-util": "^27.0
|
|
21
|
+
"jest-mock": "^27.1.0",
|
|
22
|
+
"jest-util": "^27.1.0",
|
|
23
23
|
"jsdom": "^16.6.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@jest/test-utils": "^27.0
|
|
26
|
+
"@jest/test-utils": "^27.1.0",
|
|
27
27
|
"@types/jsdom": "^16.2.4"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "5ef792e957e83428d868a18618b8629e32719993"
|
|
36
36
|
}
|