-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore(deps): bump node version #1193
base: dev
Are you sure you want to change the base?
Conversation
408eeb1
to
9f1bcc4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the Node.js version update.
I'm also supportive of the switch to Fastify as our general recommendation.
We likely need further discussion about switching to the native test runner.
I added some thoughts about node --test
usage. I like the direction, but it has its quirks and differences. It's a little annoying that coverage is still behind a flag. One other feature loss is that we no longer generate the pretty HTML coverage report that we used to get from Jest's LCOV reporter. I'm personally okay with that if we retain the Codecov bits. Here's what the HTML report looked like:
"scripts": { | ||
"lint": "standard --verbose | snazzy", | ||
"test": "jest" | ||
"test": "node --test server.test.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"test": "node --test server.test.js" | |
"test": "node --test --test-reporter=spec --test-reporter-destination=stdout --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info" |
This is actually 4 suggestions in 1.
-
Let's stop specifying
server.test.js
so that additional test files will likely be picked up automatically without needing to update this line. The docs state:By default, Node.js will run all files matching these patterns:
**/*.test.?(c|m)js
**/*-test.?(c|m)js
**/*_test.?(c|m)js
**/test-*.?(c|m)js
**/test.?(c|m)js
**/test/**/*.?(c|m)js
In my limited experience with the native test runner, tests inside of
node_modules
dependencies aren't picked up, so the default pattern matching should likely work for us. -
CI is defaulting to
tap
results instead of the more human-readablespec
(due to some auto-detection). We can switch that by specifying--test-reporter=spec
. -
We were previously summarizing test coverage data and reporting it at the end of the test results. We can do that by adding the
--experimental-test-coverage
flag while usingtap
orspec
. -
We were previously sending test coverage details to Codecov if a token was provided (see this) by generating an LCOV report and placing it inside a
coverage
directory. The Codecov action recursively searches forlcov.info
, ignoring directories likenode_modules
, and uploads it to report on diffs and track coverage trends. In order to generate that file and print the human-readable stuff to stdout, we need to do something like--test-reporter=spec --test-reporter-destination=stdout --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info
. A slightly awkward thing is that we can't specifycoverage/lcov.info
as the destination without thecoverage
directory already existing, so we'll have to update our.gitignore
.
started with bumping the node version then realized it might cut down on dependencies to move it to fastify. It was fast enough that I figured it was worth the effort. I won't be offended if we want to go another direction.