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

switch from mocha to node --test #7

Merged
merged 1 commit into from
Mar 25, 2024
Merged

switch from mocha to node --test #7

merged 1 commit into from
Mar 25, 2024

Conversation

juliangruber
Copy link
Member

The node.js test runner received some significant DX improvements. Test output is now this:

Screenshot 2024-03-24 at 20 56 33

In comparison, with mocha:

Screenshot 2024-03-24 at 20 56 43

The stdlib test runner is continuously receiving improvements and new features, so I think it's the more future ready version. Wdyt @bajtos? In order to evaluate this better, I'm also happy to port a more complicated test suite.

@juliangruber juliangruber requested a review from bajtos March 24, 2024 19:57
@juliangruber
Copy link
Member Author

juliangruber commented Mar 24, 2024

See current docs: https://nodejs.org/api/test.html

@bajtos
Copy link
Member

bajtos commented Mar 25, 2024

The new test output is much better 👍🏻

Could you please check how test failures are reported? IIRC, the last time we tried, the built-in test runner reported test failures in TAP format, which was difficult for humans to read.

@@ -2,6 +2,7 @@ import { createHandler } from '../index.js'
import http from 'node:http'
import { once } from 'node:events'
import assert from 'node:assert'
import { describe, it, before, after } from 'node:test'
Copy link
Member

Choose a reason for hiding this comment

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

👏🏻

@juliangruber
Copy link
Member Author

Screenshot 2024-03-25 at 14 23 47

also nicer now

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Cool. I hope deep-equal assertions print a succinct brief when the assertion fails, but that's a minor detail I can live without for a while.

:shipit:

@juliangruber juliangruber merged commit b37c8b2 into main Mar 25, 2024
2 checks passed
@juliangruber juliangruber deleted the update/node-test branch March 25, 2024 15:27
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