Skip to content

Commit

Permalink
fix: overwrite global URL with environment's (vitest-dev#4164)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored and LorenzoBloedow committed Dec 19, 2023
1 parent 9594e62 commit a9ff1e2
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
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
@@ -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 a9ff1e2

Please sign in to comment.