mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
test(csv): improve CsvStringifyStream
test (#5154)
This commit is contained in:
parent
ba256e3579
commit
9144a6253c
@ -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" },
|
||||
|
Loading…
Reference in New Issue
Block a user