Add failing test

This commit is contained in:
Jarred Sumner
2022-11-02 20:44:49 -07:00
parent 1a92b92f8a
commit 09434f1486

View File

@@ -9,12 +9,46 @@ import { mkfifo } from "mkfifo";
import { unlinkSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { gc } from "./gc";
new Uint8Array();
beforeEach(() => gc());
afterEach(() => gc());
describe("ReadableStream.prototype.tee", async () => {
// This test hangs, TODO: fix it
// describe("WritableStream", () => {
// it("works", async () => {
// try {
// var chunks = [];
// var writable = new WritableStream({
// write(chunk, controller) {
// chunks.push(chunk);
// },
// close(er) {
// console.log("closed");
// console.log(er);
// },
// abort(reason) {
// console.log("aborted!");
// console.log(reason);
// },
// });
// var writer = writable.getWriter();
// writer.write(new Uint8Array([1, 2, 3]));
// writer.write(new Uint8Array([4, 5, 6]));
// await writer.close();
// expect(JSON.stringify(Array.from(Buffer.concat(chunks)))).toBe(
// JSON.stringify([1, 2, 3, 4, 5, 6])
// );
// } catch (e) {
// console.log(e);
// console.log(e.stack);
// throw e;
// }
// });
// });
describe("ReadableStream.prototype.tee", () => {
it("class", () => {
const [a, b] = new ReadableStream().tee();
expect(a instanceof ReadableStream).toBe(true);