Skip to content

Commit

Permalink
Add Node v22 to CI (#64)
Browse files Browse the repository at this point in the history
* Add Node v22 to CI

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 Jul 15, 2024
1 parent a44ba87 commit 1bc7869
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x, 21.x]
node-version: [18.x, 20.x, 21.x, 22.x]
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
Expand All @@ -39,4 +39,4 @@ jobs:
- name: Run tests
run: |
npm run unit -- --reporter spec
npm run unit
13 changes: 9 additions & 4 deletions test/watch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { mkdtemp, cp, writeFile, rm } from 'node:fs/promises'
import path from 'node:path'
import { once } from 'node:events'

test('watch', async (t) => {
// These tests are currently broken on node v22
const skip = process.platform === 'darwin' && process.version.startsWith('v22')

test('watch', { skip }, async (t) => {
const { strictEqual, completed, match } = tspl(t, { plan: 3 })

const dir = path.resolve(await mkdtemp('.test-watch'))
Expand All @@ -24,15 +27,17 @@ test('watch', async (t) => {

const config = {
files: [],
cwd: dir,
signal: controller.signal,
cwd: dir,
watch: true
}

process._rawDebug('dir', dir)
const stream = await runWithTypeScript(config)

const fn = (test) => {
if (test.type === 'test:fail') {
console.log('test', test)
match(test.data.name, /add/)
stream.removeListener('data', fn)
}
Expand All @@ -58,7 +63,7 @@ test('add', () => {
await completed
})

test('watch file syntax error', async (t) => {
test('watch file syntax error', { skip }, async (t) => {
const { strictEqual, completed, match } = tspl(t, { plan: 3 })

const dir = path.resolve(await mkdtemp('.test-watch'))
Expand Down Expand Up @@ -110,7 +115,7 @@ test('add', () => {
await completed
})

test('watch with post compile hook should call the hook the right number of times', async (t) => {
test('watch with post compile hook should call the hook the right number of times', { skip }, async (t) => {
const { completed, ok, match } = tspl(t, { plan: 2 })

const dir = path.resolve(await mkdtemp('.test-watch-with-post-compile-hook'))
Expand Down

0 comments on commit 1bc7869

Please sign in to comment.