Skip to content

Replace ava with Node's built-in test runner#16

Merged
walro merged 1 commit into
mainfrom
migrate-to-node-test
Jun 25, 2026
Merged

Replace ava with Node's built-in test runner#16
walro merged 1 commit into
mainfrom
migrate-to-node-test

Conversation

@walro

@walro walro commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Fixes https://github.com/84codes/sparoid.js/security/dependabot/25 and the huge reduction in (indirect) dependencies is a win.

WHAT is this pull request doing?

Removes the ava -> supertap -> js-yaml@3 dependency chain.

Tests now run via node:test + node:assert through tsx, with no new dependencies

HOW was this pull request tested?

Tests

Removes the ava -> supertap -> js-yaml@3 dependency chain.

Tests now run via node:test + node:assert through tsx, with no new dependencies
@walro walro requested a review from a team as a code owner June 25, 2026 05:43
@walro walro requested a review from Copilot June 25, 2026 05:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the project’s test suite from ava to Node’s built-in node:test runner (using node:assert/strict), primarily to eliminate the ava → supertap → js-yaml@3 dependency chain and reduce the indirect dependency surface.

Changes:

  • Replaced ava assertions with node:assert/strict across the TypeScript tests.
  • Updated npm test to run tests via tsx --test.
  • Removed ava from devDependencies and pruned its transitive dependencies from package-lock.json.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/test.ts Switched test runner and assertions for the UDP/auth integration test.
test/message.ts Migrated Message unit tests from ava to node:test + assert.
test/ipv6.ts Migrated IPv6 parsing unit tests from ava to node:test + assert.
package.json Replaced the ava test script/config with a tsx --test invocation and removed ava devDependency.
package-lock.json Removed ava and a large set of now-unneeded transitive dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/test.ts
Comment on lines 11 to 16
await new Promise<void>((resolve, reject) => {
server.on('message', (msg) => {
t.is(msg.length, 96)
assert.equal(msg.length, 96)
server.close()
resolve()
})

@walro walro Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this must also have been an issue before? prefer not to touch it in this PR as it's about changing the runner, nothing else

@walro walro merged commit a1f2b65 into main Jun 25, 2026
6 checks passed
@walro walro deleted the migrate-to-node-test branch June 25, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants