Skip to content

Commit

Permalink
test(csv): improve CsvStringifyStream test
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Jun 26, 2024
1 parent ba256e3 commit 31cc936
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions csv/csv_stringify_stream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ Deno.test({
);
});

await t.step("with invalid `columns`", async () => {
const readable = ReadableStream.from([
["one", "two", "three"],
// deno-lint-ignore no-explicit-any
]).pipeThrough(new CsvStringifyStream({ columns: { length: 1 } as any }));
await assertRejects(
async () => await Array.fromAsync(readable),
StringifyError,
"No property accessor function was provided for object",
);
});

await t.step("with objects", async () => {
const readable = ReadableStream.from([
{ id: 1, name: "foo" },
Expand Down

0 comments on commit 31cc936

Please sign in to comment.