Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed May 8, 2022
1 parent f766f3f commit e6d5650
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vitest/src/integrations/env/utils.ts
Expand Up @@ -55,7 +55,8 @@ export function populateGlobal(global: any, win: any, options: PopulateOptions =
const globalKeys = new Set<string | symbol>(['window', 'self', 'top', 'parent'])

// we are creating a proxy that intercepts all access to the global object,
// stores new value on `override`, and returnes only these values
// stores new value on `override`, and returns only these values,
// so it actually shares only values defined inside tests
const globalProxy = new Proxy(win.window, {
get(target, p, receiver) {
if (overrideObject.has(p))
Expand All @@ -64,7 +65,7 @@ export function populateGlobal(global: any, win: any, options: PopulateOptions =
},
set(target, p, value, receiver) {
try {
// if property is defined with configurable: false,
// if property is defined with "configurable: false",
// this will throw an error, but `self.prop = value` should not throw
// this matches browser behaviour where it silently ignores the error
// and returns previously defined value, which is a hell for debugging
Expand Down

0 comments on commit e6d5650

Please sign in to comment.