Skip to content

Commit 18f0be1

Browse files
committed
Fix missing textencoder
1 parent 1ee1615 commit 18f0be1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/firestore/test/unit/util/bundle.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,16 @@ import { expect } from 'chai';
1818
import { Bundle, toReadableStream } from '../../../src/util/bundle';
1919
import { isNode } from '../../util/test_platform';
2020

21-
const encoder = new TextEncoder();
22-
2321
function readableStreamFromString(
2422
content: string,
2523
bytesPerRead: number
2624
): ReadableStream {
27-
return toReadableStream(encoder.encode(content), bytesPerRead);
25+
return toReadableStream(new TextEncoder().encode(content), bytesPerRead);
2826
}
2927

3028
function lengthPrefixedString(o: {}): string {
3129
const str = JSON.stringify(o);
32-
const l = encoder.encode(str).byteLength;
30+
const l = new TextEncoder().encode(str).byteLength;
3331
return `${l}${str}`;
3432
}
3533

0 commit comments

Comments
 (0)