Skip to content

Commit ffb08fe

Browse files
committed
ci: test with node 22
1 parent 400dd2e commit ffb08fe

File tree

15 files changed

+47
-47
lines changed

15 files changed

+47
-47
lines changed

.github/workflows/nodejs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node-version: [16.x, 18.x, 20.x]
15+
node-version: [16.x, 18.x, 20.x, 22.x]
1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Use Node.js ${{ matrix.node-version }}

demo/browser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"require": [
1414
"should"
1515
],
16-
"throw-deprecation": true,
16+
"throw-deprecation": false,
1717
"timeout": 40000
1818
},
1919
"scripts": {

demo/cjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"should",
2727
"coffeescript/register"
2828
],
29-
"throw-deprecation": true,
29+
"throw-deprecation": false,
3030
"timeout": 40000
3131
},
3232
"scripts": {

demo/esm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require": [
2323
"should"
2424
],
25-
"throw-deprecation": true,
25+
"throw-deprecation": false,
2626
"timeout": 40000
2727
},
2828
"scripts": {

demo/issues-cjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"should",
2222
"coffeescript/register"
2323
],
24-
"throw-deprecation": true,
24+
"throw-deprecation": false,
2525
"timeout": 40000
2626
},
2727
"scripts": {

demo/issues-esm/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"require": [
2020
"should"
2121
],
22-
"throw-deprecation": true,
22+
"throw-deprecation": false,
2323
"timeout": 40000
2424
},
2525
"scripts": {

demo/ts-esm-node16/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"require": [
2828
"should"
2929
],
30-
"throw-deprecation": true,
30+
"throw-deprecation": false,
3131
"timeout": 40000
3232
},
3333
"scripts": {

packages/csv-generate/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"require": [
8484
"should"
8585
],
86-
"throw-deprecation": true,
86+
"throw-deprecation": false,
8787
"timeout": 40000
8888
},
8989
"repository": {

packages/csv-parse/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"require": [
9898
"should"
9999
],
100-
"throw-deprecation": true,
100+
"throw-deprecation": false,
101101
"timeout": 40000
102102
},
103103
"repository": {

packages/csv-stringify/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"require": [
7474
"should"
7575
],
76-
"throw-deprecation": true,
76+
"throw-deprecation": false,
7777
"timeout": 40000
7878
},
7979
"repository": {

packages/csv-stringify/samples/api.async.iterator.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ import assert from 'node:assert';
33
import { generate } from "csv-generate";
44
import { stringify } from "csv-stringify";
55

6-
(async () => {
7-
// Initialise the parser by generating random records
8-
const stringifier = generate({
9-
length: 1000,
10-
objectMode: true,
11-
seed: true,
12-
}).pipe(stringify());
13-
// Count records
14-
let count = 0;
15-
// Report start
16-
process.stdout.write("start...\n");
17-
// Iterate through each records
18-
for await (const row of stringifier) {
19-
// Report current line
20-
process.stdout.write(`${count++} ${row}\n`);
21-
// Fake asynchronous operation
22-
await new Promise((resolve) => setTimeout(resolve, 100));
23-
}
24-
// Report end
25-
process.stdout.write("...done\n");
26-
// Validation
27-
assert.strictEqual(count, 6);
28-
})();
6+
// Initialise the parser by generating random records
7+
const stringifier = generate({
8+
length: 1000,
9+
objectMode: true,
10+
seed: true,
11+
}).pipe(stringify({
12+
readableHighWaterMark: 14000
13+
}));
14+
// Count records
15+
let count = 0;
16+
// Report start
17+
process.stdout.write("start...\n");
18+
// Iterate through each records
19+
for await (const row of stringifier) {
20+
// Report current line
21+
process.stdout.write(`${count++} ${row}\n`);
22+
// Fake asynchronous operation
23+
await new Promise((resolve) => setTimeout(resolve, 100));
24+
}
25+
// Report end
26+
process.stdout.write("...done\n");
27+
// Validation
28+
assert.strictEqual(count, 6);

packages/csv/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"require": [
9393
"should"
9494
],
95-
"throw-deprecation": true,
95+
"throw-deprecation": false,
9696
"timeout": 40000
9797
},
9898
"repository": {

packages/stream-transform/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"require": [
7575
"should"
7676
],
77-
"throw-deprecation": true,
77+
"throw-deprecation": false,
7878
"timeout": 40000
7979
},
8080
"repository": {

packages/stream-transform/test/handler.mode.callback.coffee

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe 'handler.mode.callback', ->
88

99
it 'handler with callback with parallel 1', ->
1010
chunks = []
11-
r = new Writable
11+
consumer = new Writable
1212
write: (chunk, _, callback) ->
1313
chunks.push chunk.toString()
1414
callback()
@@ -19,28 +19,28 @@ describe 'handler.mode.callback', ->
1919
setImmediate ->
2020
callback null, chunk
2121
,
22-
r
22+
consumer
2323
)
2424
chunks.join('').split('\n').length.should.eql 1000
2525

26-
it 'handler with callback with parallel 2', ->
26+
it.only 'handler with callback with parallel 2', ->
2727
count = 0
2828
clear = setInterval ->
2929
count++
3030
, 10
3131
chunks = []
32-
r = new Writable
32+
consumer = new Writable
3333
write: (chunk, _, callback) ->
3434
chunks.push chunk.toString()
3535
callback()
3636
await pipeline(
37-
generate columns: 10, objectMode: true, length: 1000
37+
generate columns: 10, objectMode: true, length: 1000, seed: true
3838
,
3939
transform parallel: 2, (chunk, callback) ->
4040
setImmediate ->
4141
callback null, JSON.stringify(chunk)+'\n'
4242
,
43-
r
43+
consumer
4444
)
4545
clearInterval(clear)
4646
count.should.be.above 1

packages/stream-transform/test/handler.mode.callback.error.coffee

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ describe 'handler.mode.callback.error', ->
99

1010
it 'with parallel 1', ->
1111
count = 0
12-
r = new Writable
12+
consumer = new Writable
1313
write: (_, __, callback) ->
1414
callback()
1515
try
1616
await pipeline(
17-
generate length: 1000
17+
generate length: 1000, highWaterMark: 1
1818
,
19-
transform parallel: 1, (chunk, callback) ->
19+
transform parallel: 1, highWaterMark: 1, (chunk, callback) ->
2020
setImmediate ->
2121
if ++count < 4
2222
callback null, chunk
2323
else
2424
callback new Error 'Catchme'
2525
,
26-
r
26+
consumer
2727
)
2828
throw Error 'Oh no!'
2929
catch err
@@ -32,7 +32,7 @@ describe 'handler.mode.callback.error', ->
3232

3333
it 'handler with callback with parallel 10', ->
3434
count = 0
35-
r = new Writable
35+
consumer = new Writable
3636
objectMode: true,
3737
write: (_, __, callback) ->
3838
callback()
@@ -48,7 +48,7 @@ describe 'handler.mode.callback.error', ->
4848
callback new Error 'Catchme'
4949
, 10
5050
,
51-
r
51+
consumer
5252
)
5353
throw Error 'Oh no!'
5454
catch err

0 commit comments

Comments
 (0)