const c = await s.getReader().read().then(({ value }) => value);
deepStrictEqual(c, undefined);
});
+ test('works with instanceof', { concurrency: true }, async () => {
+ const path = new URL('./data/simple.csv', import.meta.url);
+ const s = new CSVReader(path);
+ deepStrictEqual(s instanceof CSVReader, true);
+ await s.cancel();
+ });
});
suite('CSVTransformer', { concurrency: true }, () => {
]));
deepStrictEqual(fn.mock.callCount(), 2);
});
+ test('works with instanceof', { concurrency: true }, async () => {
+ const s = new CSVTransformer(r => r);
+ deepStrictEqual(s instanceof CSVTransformer, true);
+ });
});
suite('CSVWriter', { concurrency: true }, () => {
await rejects(writer.write('b'));
await new CSVReader(temp).pipeTo(csvStreamEqualWritable([['a']]));
});
+ test('works with instanceof', { concurrency: true }, async (t) => {
+ const temp = await createTempFile();
+ t.after(async () => await unlink(temp));
+ const s = new CSVWriter(temp);
+ deepStrictEqual(s instanceof CSVWriter, true);
+ await s.abort();
+ });
});
suite('CSVWriter status', { concurrency: true }, () => {
['a', 'b']
]));
});
+ test('works with instanceof', { concurrency: true }, async () => {
+ const s = new CSVNormalizer([]);
+ deepStrictEqual(s instanceof CSVNormalizer, true);
+ });
});
suite('CSVDenormalizer', { concurrency: true }, () => {
['a2', 'b2']
]));
});
+ test('works with instanceof', { concurrency: true }, async () => {
+ const s = new CSVDenormalizer();
+ deepStrictEqual(s instanceof CSVDenormalizer, true);
+ });
});
suite('CSVNormalizer and CSVDenormalizer end-to-end', { concurrency: true }, () => {