File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
packages/vitest/src/integrations/env Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 1- import { importModule } from 'local-pkg'
21import type { Environment } from '../../types'
32import { populateGlobal } from './utils'
43import { KEYS } from './jsdom-keys'
@@ -7,7 +6,7 @@ export default <Environment>({
76 name : 'edge-runtime' ,
87 transformMode : 'ssr' ,
98 async setupVM ( ) {
10- const { EdgeVM } = await importModule ( '@edge-runtime/vm' ) as typeof import ( '@edge-runtime/vm' )
9+ const { EdgeVM } = await import ( '@edge-runtime/vm' )
1110 const vm = new EdgeVM ( {
1211 extend : ( context ) => {
1312 context . global = context
@@ -25,7 +24,7 @@ export default <Environment>({
2524 }
2625 } ,
2726 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' )
2928 const vm = new EdgeVM ( {
3029 extend : ( context ) => {
3130 context . global = context
Original file line number Diff line number Diff line change 1- import { importModule } from 'local-pkg'
21import type { Environment } from '../../types'
32import { populateGlobal } from './utils'
43
54export default < Environment > ( {
65 name : 'happy-dom' ,
76 transformMode : 'web' ,
87 async setupVM ( { happyDOM = { } } ) {
9- const { Window } = await importModule ( 'happy-dom' ) as typeof import ( 'happy-dom' )
8+ const { Window } = await import ( 'happy-dom' )
109 const win = new Window ( {
1110 ...happyDOM ,
1211 console : ( console && globalThis . console ) ? globalThis . console : undefined ,
@@ -36,7 +35,7 @@ export default <Environment>({
3635 async setup ( global , { happyDOM = { } } ) {
3736 // happy-dom v3 introduced a breaking change to Window, but
3837 // 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' )
4039 const win = new ( GlobalWindow || Window ) ( {
4140 ...happyDOM ,
4241 console : ( console && global . console ) ? global . console : undefined ,
Original file line number Diff line number Diff line change 1- import { importModule } from 'local-pkg'
21import type { Environment } from '../../types'
32import { populateGlobal } from './utils'
43
@@ -35,7 +34,7 @@ export default <Environment>({
3534 JSDOM ,
3635 ResourceLoader,
3736 VirtualConsole,
38- } = await importModule ( 'jsdom' ) as typeof import ( 'jsdom' )
37+ } = await import ( 'jsdom' )
3938 const {
4039 html = '<!DOCTYPE html>' ,
4140 userAgent,
@@ -107,7 +106,7 @@ export default <Environment>({
107106 JSDOM ,
108107 ResourceLoader,
109108 VirtualConsole,
110- } = await importModule ( 'jsdom' ) as typeof import ( 'jsdom' )
109+ } = await import ( 'jsdom' )
111110 const {
112111 html = '<!DOCTYPE html>' ,
113112 userAgent,
You can’t perform that action at this time.
0 commit comments