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

node:test support #308

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
CI:
strategy:
matrix:
node: ["16.x", "18.x"]
node: ["18.x", "20.x", "22.x"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for the change is that 16 is EOL'ed, and I believe it doesn't support node:test.

Also added 20 and 22 to make sure it works with them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node:test is much better in 22. It was more experimental in the previous versions.

os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}

Expand Down
7 changes: 0 additions & 7 deletions examples/example-node-runner/.mocharc.js

This file was deleted.

9 changes: 6 additions & 3 deletions examples/example-node-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
"lint": "biome check ./src",
"lint:fix": "biome check --apply ./src",
"typecheck": "tsc --noEmit",
"test": "node --test --loader ts-node/esm src/*.test.ts",
"test": "glob -c \"node --test --test-reporter=@voxpelli/node-test-pretty-reporter --loader ts-node/esm\" \"src/*.test.ts\"",
mateuszradomski marked this conversation as resolved.
Show resolved Hide resolved
"test:fix": "pnpm lint:fix && pnpm format:fix && pnpm test && pnpm typecheck"
},
"dependencies": {
"earl": "workspace:^1.2.1",
"example-plugin": "workspace:^1.0.0"
alcuadrado marked this conversation as resolved.
Show resolved Hide resolved
"earl": "workspace:^1.2.1"
},
"devDependencies": {
"@voxpelli/node-test-pretty-reporter": "^1.1.1",
"glob": "^10.3.15"
}
}
3 changes: 2 additions & 1 deletion packages/earl/src/errors/stack-traces.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fileURLToPath } from 'node:url'
import { expect } from 'chai'
import ErrorStackParser from 'error-stack-parser'

Expand Down Expand Up @@ -41,6 +42,6 @@ describe('stack traces for errors', () => {
return nestedGetControl()
}
const control = nestedValidator()
expect(control.file).to.equal(import.meta.url)
expect(control.file).to.equal(fileURLToPath(import.meta.url))
mateuszradomski marked this conversation as resolved.
Show resolved Hide resolved
})
})
Loading
Loading