jest-environment-jsdom 28.1.1 → 29.0.0-alpha.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 CHANGED
@@ -6,18 +6,19 @@
6
6
  */
7
7
  /// <reference types="node" />
8
8
 
9
+ /// <reference lib="dom" />
10
+
9
11
  import type {Context} from 'vm';
10
12
  import type {EnvironmentContext} from '@jest/environment';
11
13
  import type {Global} from '@jest/types';
12
14
  import type {JestEnvironment} from '@jest/environment';
13
15
  import type {JestEnvironmentConfig} from '@jest/environment';
14
- import {JSDOM} from 'jsdom';
15
16
  import {LegacyFakeTimers} from '@jest/fake-timers';
16
17
  import {ModernFakeTimers} from '@jest/fake-timers';
17
18
  import {ModuleMocker} from 'jest-mock';
18
19
 
19
20
  declare class JSDOMEnvironment implements JestEnvironment<number> {
20
- dom: JSDOM | null;
21
+ private dom;
21
22
  fakeTimers: LegacyFakeTimers<number> | null;
22
23
  fakeTimersModern: ModernFakeTimers | null;
23
24
  global: Win;
package/build/index.js CHANGED
@@ -51,7 +51,10 @@ function _jestUtil() {
51
51
  * This source code is licensed under the MIT license found in the
52
52
  * LICENSE file in the root directory of this source tree.
53
53
  */
54
+ /// <reference lib="dom" />
55
+ // @ts-expect-error: TODO: we're missing v20 types
54
56
  class JSDOMEnvironment {
57
+ // TODO: make non-privat when we have `@types/jsdom` again
55
58
  dom;
56
59
  fakeTimers;
57
60
  fakeTimersModern;
@@ -65,7 +68,8 @@ class JSDOMEnvironment {
65
68
  const virtualConsole = new (_jsdom().VirtualConsole)();
66
69
  virtualConsole.sendTo(context.console, {
67
70
  omitJSDOMErrors: true
68
- });
71
+ }); // @ts-expect-error: TODO: we're missing v20 types
72
+
69
73
  virtualConsole.on('jsdomError', error => {
70
74
  context.console.error(error);
71
75
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-environment-jsdom",
3
- "version": "28.1.1",
3
+ "version": "29.0.0-alpha.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/facebook/jest.git",
@@ -17,23 +17,22 @@
17
17
  "./package.json": "./package.json"
18
18
  },
19
19
  "dependencies": {
20
- "@jest/environment": "^28.1.1",
21
- "@jest/fake-timers": "^28.1.1",
22
- "@jest/types": "^28.1.1",
23
- "@types/jsdom": "^16.2.4",
20
+ "@jest/environment": "^29.0.0-alpha.0",
21
+ "@jest/fake-timers": "^29.0.0-alpha.0",
22
+ "@jest/types": "^29.0.0-alpha.0",
24
23
  "@types/node": "*",
25
- "jest-mock": "^28.1.1",
26
- "jest-util": "^28.1.1",
27
- "jsdom": "^19.0.0"
24
+ "jest-mock": "^29.0.0-alpha.0",
25
+ "jest-util": "^29.0.0-alpha.0",
26
+ "jsdom": "^20.0.0"
28
27
  },
29
28
  "devDependencies": {
30
- "@jest/test-utils": "^28.1.1"
29
+ "@jest/test-utils": "^29.0.0-alpha.0"
31
30
  },
32
31
  "engines": {
33
- "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0"
32
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
34
33
  },
35
34
  "publishConfig": {
36
35
  "access": "public"
37
36
  },
38
- "gitHead": "eb954f8874960920ac50a8f976bb333fbb06ada9"
37
+ "gitHead": "6862afb00307b52f32eedee977a9b3041355f184"
39
38
  }