Skip to content

Commit

Permalink
test(wasm): reference atob polyfill in browser test (#1179)
Browse files Browse the repository at this point in the history
The "target environment browser" test invoked the bundled output, which
leads to an undefined error on node 14 as [`atob` was introduced in node
16][0].

This commit uses the same atob polyfill that was introduced in #334

[0]: https://developer.mozilla.org/en-US/docs/Web/API/atob#browser_compatibility
  • Loading branch information
nickbabcock authored Apr 29, 2022
1 parent 50b618b commit 5fa2bc8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/wasm/test/fixtures/async.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import fixture from './sample.wasm';

// eslint-disable-next-line no-undef
globalThis.atob = (str) => Buffer.from(str, 'base64').toString('binary');

// eslint-disable-next-line no-undef
result = (async () => {
const module = await fixture();
Expand Down

0 comments on commit 5fa2bc8

Please sign in to comment.