Skip to content

Commit

Permalink
ci: test with node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Aug 26, 2024
1 parent 400dd2e commit 7ba7fc8
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion demo/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion demo/cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"should",
"coffeescript/register"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion demo/esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion demo/issues-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"should",
"coffeescript/register"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion demo/issues-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion demo/ts-esm-node16/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/csv-generate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/csv-parse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/csv-stringify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"repository": {
Expand Down
46 changes: 23 additions & 23 deletions packages/csv-stringify/samples/api.async.iterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ import assert from 'node:assert';
import { generate } from "csv-generate";
import { stringify } from "csv-stringify";

(async () => {
// Initialise the parser by generating random records
const stringifier = generate({
length: 1000,
objectMode: true,
seed: true,
}).pipe(stringify());
// Count records
let count = 0;
// Report start
process.stdout.write("start...\n");
// Iterate through each records
for await (const row of stringifier) {
// Report current line
process.stdout.write(`${count++} ${row}\n`);
// Fake asynchronous operation
await new Promise((resolve) => setTimeout(resolve, 100));
}
// Report end
process.stdout.write("...done\n");
// Validation
assert.strictEqual(count, 6);
})();
// Initialise the parser by generating random records
const stringifier = generate({
length: 1000,
objectMode: true,
seed: true,
}).pipe(stringify({
readableHighWaterMark: 14000
}));
// Count records
let count = 0;
// Report start
process.stdout.write("start...\n");
// Iterate through each records
for await (const row of stringifier) {
// Report current line
process.stdout.write(`${count++} ${row}\n`);
// Fake asynchronous operation
await new Promise((resolve) => setTimeout(resolve, 100));
}
// Report end
process.stdout.write("...done\n");
// Validation
assert.strictEqual(count, 6);
2 changes: 1 addition & 1 deletion packages/csv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/stream-transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"require": [
"should"
],
"throw-deprecation": true,
"throw-deprecation": false,
"timeout": 40000
},
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ describe 'handler.mode.callback.error', ->
callback()
try
await pipeline(
generate length: 1000
generate length: 1000, highWaterMark: 1
,
transform parallel: 1, (chunk, callback) ->
transform parallel: 1, highWaterMark: 1, (chunk, callback) ->
setImmediate ->
if ++count < 4
callback null, chunk
Expand Down

0 comments on commit 7ba7fc8

Please sign in to comment.