From: Ardis Lu Date: Sat, 13 Sep 2025 05:15:07 +0000 (-0700) Subject: Clean up unused variables X-Git-Tag: v0.1.6~9 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=494c7513555fbc8bc908b7cf8b7bf02728b8fef4;p=csvio Clean up unused variables --- diff --git a/test/core.test.js b/test/core.test.js index db893e7..f2efd95 100644 --- a/test/core.test.js +++ b/test/core.test.js @@ -720,7 +720,7 @@ suite('CSVWriter', { concurrency: true }, () => { deepStrictEqual(s instanceof CSVWriter, true); await s.abort(); }); - test('can create TransformStream (raw strings)', { concurrency: true }, async (t) => { + test('can create TransformStream (raw strings)', { concurrency: true }, async () => { const input = new URL('./data/simple.csv', import.meta.url); const stream = new CSVReader(input).pipeThrough(new CSVWriter()); const expected = [ @@ -757,7 +757,7 @@ suite('CSVWriter status', { concurrency: true }, () => { await createCSVMockStream([['']]).pipeTo(writer); deepStrictEqual(writer.status.name, basename(temp)); }); - test('records file name of "null" if CSVWriter is a TransformStream', { concurrency: true }, async (t) => { + test('records file name of "null" if CSVWriter is a TransformStream', { concurrency: true }, async () => { const writer = new CSVWriter(); const stream = createCSVMockStream([['']]).pipeThrough(writer); deepStrictEqual(writer.status.name, null); @@ -828,7 +828,7 @@ suite('CSVWriter status', { concurrency: true }, () => { ['row 3', 'c'] ])); }); - test('counts raw CSV string as one row when TransformStream', { concurrency: true }, async (t) => { + test('counts raw CSV string as one row when TransformStream', { concurrency: true }, async () => { const writer = new CSVWriter(); const stream = createCSVMockStream([['']]) .pipeThrough(new CSVTransformer(() => 'row 1,a\r\nrow 2,b\r\nrow 3,c', { handleHeaders: true })) diff --git a/test/errorStrategies.test.js b/test/errorStrategies.test.js index 177c46b..124446e 100644 --- a/test/errorStrategies.test.js +++ b/test/errorStrategies.test.js @@ -46,7 +46,7 @@ suite('ErrorStrategies.skip', { concurrency: true }, () => { ['2', '2', '2'], ['3', '3', '3'] ]) - .pipeThrough(new CSVTransformer(r => { throw new Error(); }, { onError: skip() })) + .pipeThrough(new CSVTransformer(() => { throw new Error(); }, { onError: skip() })) .pipeTo(csvStreamEqualWritable([ ['header', 'header', 'header'] ])); @@ -59,7 +59,7 @@ suite('ErrorStrategies.placeholder', { concurrency: true }, () => { ['header', 'header', 'header'], ['1', '1', '1'] ]) - .pipeThrough(new CSVTransformer(r => { throw new Error(); }, { onError: placeholder('n/a') })) + .pipeThrough(new CSVTransformer(() => { throw new Error(); }, { onError: placeholder('n/a') })) .pipeTo(csvStreamEqualWritable([ ['header', 'header', 'header'], ['n/a', 'n/a', 'n/a'] @@ -71,7 +71,7 @@ suite('ErrorStrategies.placeholder', { concurrency: true }, () => { ['1', '1', '1'], ['1', '1', '1'] ]) - .pipeThrough(new CSVTransformer(r => { throw new Error(); }, { onError: placeholder('n/a') })) + .pipeThrough(new CSVTransformer(() => { throw new Error(); }, { onError: placeholder('n/a') })) .pipeTo(csvStreamEqualWritable([ ['header', 'header', 'header'], ['n/a', 'n/a', 'n/a'], @@ -83,7 +83,7 @@ suite('ErrorStrategies.placeholder', { concurrency: true }, () => { ['header', 'header', 'header'], ['1'] ]) - .pipeThrough(new CSVTransformer(r => { throw new Error(); }, { onError: placeholder('n/a') })) + .pipeThrough(new CSVTransformer(() => { throw new Error(); }, { onError: placeholder('n/a') })) .pipeTo(csvStreamEqualWritable([ ['header', 'header', 'header'], ['n/a'] @@ -94,7 +94,7 @@ suite('ErrorStrategies.placeholder', { concurrency: true }, () => { ['header', 'header', 'header'], [] ]) - .pipeThrough(new CSVTransformer(r => { throw new Error(); }, { onError: placeholder('n/a') })) + .pipeThrough(new CSVTransformer(() => { throw new Error(); }, { onError: placeholder('n/a') })) .pipeTo(csvStreamEqualWritable([ ['header', 'header', 'header'], ['n/a']