Skip to content

Commit f11cc8e

Browse files
committed
fix missing global TextEncoder in browser package tests
1 parent 99a9ee8 commit f11cc8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/browser/test/package/npm-build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const path = require('path');
55
const webpack = require('webpack');
66
const { JSDOM } = require('jsdom');
77

8+
Error.stackTraceLimit = Infinity;
9+
810
webpack(
911
{
1012
entry: path.join(__dirname, 'test-code.js'),
@@ -43,6 +45,9 @@ function runTests() {
4345
const bundlePath = path.join(__dirname, 'tmp.js');
4446
const { window } = new JSDOM('', { runScripts: 'dangerously' });
4547

48+
// This is a workaround for https://github.com/jsdom/jsdom/issues/2524
49+
window.TextEncoder = TextEncoder;
50+
4651
window.onerror = function () {
4752
console.error('ERROR thrown in manual test:');
4853
console.error(arguments);

0 commit comments

Comments
 (0)