Skip to content

Commit

Permalink
chore: populate edge context
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 22, 2023
1 parent c57b22f commit ba3928e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/vitest/src/integrations/env/edge-runtime.ts
@@ -1,6 +1,7 @@
import { importModule } from 'local-pkg'
import type { Environment } from '../../types'
import { populateGlobal } from './utils'
import { KEYS } from './jsdom-keys'

export default <Environment>({
name: 'edge-runtime',
Expand Down Expand Up @@ -29,6 +30,10 @@ export default <Environment>({
extend: (context) => {
context.global = context
context.Buffer = Buffer
KEYS.forEach((key) => {
if (key in global)
context[key] = global[key]
})
return context
},
})
Expand Down

0 comments on commit ba3928e

Please sign in to comment.