We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c5f2c2 commit c65cc58Copy full SHA for c65cc58
test/whatwg-streams.test.ts
@@ -1,10 +1,21 @@
1
import { deepStrictEqual } from "assert";
2
import { decodeAsync, encode, decodeArrayStream } from "@msgpack/msgpack";
3
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
+
16
describe("whatwg streams", () => {
17
before(function() {
- // Edge <= 18 has no ReadableStream constructor
- if (typeof ReadableStream !== "function") {
18
+ if (!isReadableStreamConstructorAvailable) {
19
this.skip();
20
}
21
});
0 commit comments