File tree 3 files changed +6
-9
lines changed
packages/vitest/src/integrations/env
3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
- import { importModule } from 'local-pkg'
2
1
import type { Environment } from '../../types'
3
2
import { populateGlobal } from './utils'
4
3
import { KEYS } from './jsdom-keys'
@@ -7,7 +6,7 @@ export default <Environment>({
7
6
name : 'edge-runtime' ,
8
7
transformMode : 'ssr' ,
9
8
async setupVM ( ) {
10
- const { EdgeVM } = await importModule ( '@edge-runtime/vm' ) as typeof import ( '@edge-runtime/vm' )
9
+ const { EdgeVM } = await import ( '@edge-runtime/vm' )
11
10
const vm = new EdgeVM ( {
12
11
extend : ( context ) => {
13
12
context . global = context
@@ -25,7 +24,7 @@ export default <Environment>({
25
24
}
26
25
} ,
27
26
async setup ( global ) {
28
- const { EdgeVM } = await importModule ( '@edge-runtime/vm' ) as typeof import ( '@edge-runtime/vm' )
27
+ const { EdgeVM } = await import ( '@edge-runtime/vm' )
29
28
const vm = new EdgeVM ( {
30
29
extend : ( context ) => {
31
30
context . global = context
Original file line number Diff line number Diff line change 1
- import { importModule } from 'local-pkg'
2
1
import type { Environment } from '../../types'
3
2
import { populateGlobal } from './utils'
4
3
5
4
export default < Environment > ( {
6
5
name : 'happy-dom' ,
7
6
transformMode : 'web' ,
8
7
async setupVM ( { happyDOM = { } } ) {
9
- const { Window } = await importModule ( 'happy-dom' ) as typeof import ( 'happy-dom' )
8
+ const { Window } = await import ( 'happy-dom' )
10
9
const win = new Window ( {
11
10
...happyDOM ,
12
11
console : ( console && globalThis . console ) ? globalThis . console : undefined ,
@@ -36,7 +35,7 @@ export default <Environment>({
36
35
async setup ( global , { happyDOM = { } } ) {
37
36
// happy-dom v3 introduced a breaking change to Window, but
38
37
// provides GlobalWindow as a way to use previous behaviour
39
- const { Window, GlobalWindow } = await importModule ( 'happy-dom' ) as typeof import ( 'happy-dom' )
38
+ const { Window, GlobalWindow } = await import ( 'happy-dom' )
40
39
const win = new ( GlobalWindow || Window ) ( {
41
40
...happyDOM ,
42
41
console : ( console && global . console ) ? global . console : undefined ,
Original file line number Diff line number Diff line change 1
- import { importModule } from 'local-pkg'
2
1
import type { Environment } from '../../types'
3
2
import { populateGlobal } from './utils'
4
3
@@ -35,7 +34,7 @@ export default <Environment>({
35
34
JSDOM ,
36
35
ResourceLoader,
37
36
VirtualConsole,
38
- } = await importModule ( 'jsdom' ) as typeof import ( 'jsdom' )
37
+ } = await import ( 'jsdom' )
39
38
const {
40
39
html = '<!DOCTYPE html>' ,
41
40
userAgent,
@@ -107,7 +106,7 @@ export default <Environment>({
107
106
JSDOM ,
108
107
ResourceLoader,
109
108
VirtualConsole,
110
- } = await importModule ( 'jsdom' ) as typeof import ( 'jsdom' )
109
+ } = await import ( 'jsdom' )
111
110
const {
112
111
html = '<!DOCTYPE html>' ,
113
112
userAgent,
You can’t perform that action at this time.
0 commit comments