Skip to content

Commit

Permalink
chore: don't expose node Uint8Array instead of jsdom Uint8Array
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Aug 24, 2023
1 parent 36af0b5 commit 34a69d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 2 additions & 3 deletions packages/vitest/src/integrations/env/happy-dom.ts
Expand Up @@ -14,7 +14,6 @@ export default <Environment>({

// TODO: browser doesn't expose Buffer, but a lot of dependencies use it
win.Buffer = Buffer
win.Uint8Array = Uint8Array

// inject structuredClone if it exists
if (typeof structuredClone !== 'undefined' && !win.structuredClone)
Expand All @@ -24,8 +23,8 @@ export default <Environment>({
getVmContext() {
return win
},
teardown() {
win.happyDOM.cancelAsync()
async teardown() {
await win.happyDOM.cancelAsync()
},
}
},
Expand Down
2 changes: 0 additions & 2 deletions packages/vitest/src/integrations/env/jsdom.ts
Expand Up @@ -68,8 +68,6 @@ export default <Environment>({

// TODO: browser doesn't expose Buffer, but a lot of dependencies use it
dom.window.Buffer = Buffer
// Buffer extends Uint8Array
dom.window.Uint8Array = Uint8Array

// inject structuredClone if it exists
if (typeof structuredClone !== 'undefined' && !dom.window.structuredClone)
Expand Down

0 comments on commit 34a69d1

Please sign in to comment.