jest-environment-jsdom 27.0.6 → 27.2.2

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 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 currntly causes tests to run really slow
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.6",
3
+ "version": "27.2.2",
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.6",
18
- "@jest/fake-timers": "^27.0.6",
19
- "@jest/types": "^27.0.6",
17
+ "@jest/environment": "^27.2.2",
18
+ "@jest/fake-timers": "^27.2.2",
19
+ "@jest/types": "^27.1.1",
20
20
  "@types/node": "*",
21
- "jest-mock": "^27.0.6",
22
- "jest-util": "^27.0.6",
21
+ "jest-mock": "^27.1.1",
22
+ "jest-util": "^27.2.0",
23
23
  "jsdom": "^16.6.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@jest/test-utils": "^27.0.6",
26
+ "@jest/test-utils": "^27.2.2",
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": "d257d1c44ba62079bd4307ae78ba226d47c56ac9"
35
+ "gitHead": "f54d96fec55518640b900d6994b2c4153316d1ed"
36
36
  }