Skip to content

Commit c65cc58

Browse files
committed
fix skip condition for Edge again
1 parent 7c5f2c2 commit c65cc58

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/whatwg-streams.test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import { deepStrictEqual } from "assert";
22
import { decodeAsync, encode, decodeArrayStream } from "@msgpack/msgpack";
33

4+
const isReadableStreamConstructorAvailable: boolean = (() => {
5+
try {
6+
// Edge <= 18 has ReadableStream but its constructor is not available
7+
new ReadableStream({
8+
start() {},
9+
});
10+
return true;
11+
} catch {
12+
return false;
13+
}
14+
})();
15+
416
describe("whatwg streams", () => {
517
before(function() {
6-
// Edge <= 18 has no ReadableStream constructor
7-
if (typeof ReadableStream !== "function") {
18+
if (!isReadableStreamConstructorAvailable) {
819
this.skip();
920
}
1021
});

0 commit comments

Comments
 (0)