Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
regex tst
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Oct 20, 2023
1 parent 78a2df8 commit 8ec5faf
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/async/deserializeAsync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,21 +734,18 @@ test("e2e: client aborted request", async () => {
}

expect(results).toEqual([0, 1, 2, 3, 4, 5]);
expect(iteratorError).toMatchInlineSnapshot(
"[TsonStreamInterruptedError: Stream interrupted: The operation was aborted.]",
);
expect(iteratorError).toMatch(/operation was aborted/);
}

expect(parseOptions.onStreamError).toHaveBeenCalledTimes(1);

const streamError = parseOptions.onStreamError.mock.calls[0]![0]!;
expect(streamError).toMatchInlineSnapshot(
"[TsonStreamInterruptedError: Stream interrupted: The operation was aborted.]",
);

expect(streamError.cause).toMatchInlineSnapshot(
"[AbortError: The operation was aborted.]",
);
expect(streamError).toMatch(/operation was aborted/);

assert(streamError.cause instanceof Error);
expect(streamError.cause.message).toMatch(/operation was aborted/);
expect(streamError.cause.name).toMatchInlineSnapshot('"AbortError"');

expect(iteratorChunks.length).toBeLessThan(10);
expect(iteratorChunks).toMatchInlineSnapshot(`
Expand Down

0 comments on commit 8ec5faf

Please sign in to comment.