Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Node v22 to CI #64

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading