|
6 | 6 | */ |
7 | 7 |
|
8 | 8 | import type {EnvironmentContext} from '@jest/environment'; |
9 | | -import { |
10 | | - makeGlobalConfig, |
11 | | - makeProjectConfig, |
12 | | - onNodeVersions, |
13 | | -} from '@jest/test-utils'; |
| 9 | +import {makeGlobalConfig, makeProjectConfig} from '@jest/test-utils'; |
14 | 10 | import NodeEnvironment from '../'; |
15 | | -import {AsyncLocalStorage, createHook} from 'async_hooks'; |
16 | | -import {clsx} from 'clsx'; |
17 | 11 |
|
18 | 12 | const context: EnvironmentContext = { |
19 | 13 | console, |
@@ -93,28 +87,4 @@ describe('NodeEnvironment', () => { |
93 | 87 | test('TextEncoder references the same global Uint8Array constructor', () => { |
94 | 88 | expect(new TextEncoder().encode('abc')).toBeInstanceOf(Uint8Array); |
95 | 89 | }); |
96 | | - |
97 | | - test('dispatch event', () => { |
98 | | - new EventTarget().dispatchEvent(new Event('foo')); |
99 | | - }); |
100 | | - |
101 | | - test('set modules on global', () => { |
102 | | - (globalThis as any).async_hooks = require('async_hooks'); |
103 | | - (globalThis as any).AsyncLocalStorage = |
104 | | - require('async_hooks').AsyncLocalStorage; |
105 | | - (globalThis as any).createHook = require('async_hooks').createHook; |
106 | | - (globalThis as any).clsx = require('clsx'); |
107 | | - expect(AsyncLocalStorage).toBeDefined(); |
108 | | - expect(clsx).toBeDefined(); |
109 | | - expect(createHook).toBeDefined(); |
110 | | - expect(createHook({})).toBeDefined(); |
111 | | - expect(clsx()).toBeDefined(); |
112 | | - }); |
113 | | - |
114 | | - onNodeVersions('>=19.8.0', () => { |
115 | | - test('use static function from core module set on global', () => { |
116 | | - expect(AsyncLocalStorage.snapshot).toBeDefined(); |
117 | | - expect(AsyncLocalStorage.snapshot()).toBeDefined(); |
118 | | - }); |
119 | | - }); |
120 | 90 | }); |
0 commit comments