Skip to content

Commit

Permalink
fix: overwrite global URL with environment's (#4164)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Sep 29, 2023
1 parent 859d236 commit cbe133d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/vitest/src/integrations/env/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const skipKeys = [
'self',
'top',
'parent',
'URL',
]

export function getWindowKeys(global: any, win: any) {
Expand Down
11 changes: 11 additions & 0 deletions test/core/test/environments/node.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @vitest-environment node

import { expect, test } from 'vitest'

const nodeMajor = Number(process.version.slice(1).split('.')[0])

test.runIf(nodeMajor > 16)('url correctly creates an object', () => {
expect(() => {
URL.createObjectURL(new Blob([]))
}).not.toThrow()
})

0 comments on commit cbe133d

Please sign in to comment.