Skip to content

Commit

Permalink
run ci on node 22 (#147)
Browse files Browse the repository at this point in the history
* run ci on node 22

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup

Signed-off-by: Matteo Collina <hello@matteocollina.com>

---------

Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Apr 29, 2024
1 parent 87cfbe7 commit 932a5da
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ jobs:
contents: read
strategy:
matrix:
node-version: [14, 16, 18, 20]
node-version: [18, 20, 22]
os: [macos-latest, ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
node-version: 14
- os: macos-latest
node-version: 14
- os: macos-latest
node-version: 16
node-version: 22

steps:
- name: Check out repo
Expand Down
1 change: 0 additions & 1 deletion lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ process.once('exit', exitCode => {
process.exit(exitCode)
return
}

if (destination?.writableNeedDrain && !destination?.writableEnded) {
parentPort.postMessage({
code: 'WARNING',
Expand Down
4 changes: 3 additions & 1 deletion test/never-drain.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function retryUntilTimeout (fn, timeout) {
})
}

test('emit warning when the worker gracefully exit without the stream ended', async function (t) {
const isNode18 = process.version.indexOf('v18') === 0

test('emit warning when the worker gracefully exit without the stream ended', { skip: !isNode18 }, async function (t) {
const expectedWarning = 'ThreadStream: process exited before destination stream was drained. this may indicate that the destination stream try to write to a another missing stream'
const stream = new ThreadStream({
filename: join(__dirname, 'to-next.js')
Expand Down
2 changes: 2 additions & 0 deletions test/pkg/pkg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ test('worker test when packaged into executable using pkg', async (t) => {
// package the app into several node versions, check config for more info
const filePath = `${join(__dirname, packageName)}.js`
const configPath = join(__dirname, 'pkg.config.json')
process.env.NODE_OPTIONS ||= ''
process.env.NODE_OPTIONS = '--no-warnings'
const { stderr } = await exec(`npx pkg ${filePath} --config ${configPath}`)

// there should be no error when packaging
Expand Down

0 comments on commit 932a5da

Please sign in to comment.