standard-engine
standard-engine copied to clipboard
Post Node 14: Replace `tape` with `node:test`?
It was a long time since tape received any updates and ~~brittle has emerged as the new TAP test framework "for modern times"~~ node:test is now included with Node.js itself and makes sense to use.
I would suggest moving to ~~brittle~~ node:test once we drop support for Node 12.
What are the advantages to use brittle instead of tape, except that tape didn't received any updates since long time ?
There are also ava or uvu test runners to consider, it is worth taking a look.
I would say that brittle is the modern incarnation of tape.
I myself use mocha + chai in my projects, but swapping to mocha, ava or something similar would be a more major undertaking + not really vibe with the original spirit of tape
Similar move: https://github.com/hypercore-protocol/hypercore-next/pull/39
Brittle seems very new and only have ~90 weekly downloads compared to ~640,000 for tape. Doesn't have to mean anything if the later is getting actively maintained, but could potentially be smart to hold on for a little while...
I myself also use mocha (but without chai though) mostly, and Jest/AVA for larger projects.
edit: actually, I see no problems with switching right away actually, seems like other projects are doing it and it only affects our tests
My impression was that more repositories was about to move to it, but I see now that there aren't that many 🤔 https://github.com/davidmarkclements/brittle/network/dependents?dependent_type=REPOSITORY
Found the thread I remembered on Twitter with eg. @mcollina: https://twitter.com/matteocollina/status/1447973242581524486
I cannot move any of my repositories until I have to support Node v12.
@mcollina But you will after Node 12 has left LTS in about six months time?
I'll start testing/using it with smaller repos first and then slowly migrate. The integrated runner with the additional code coverage tool based on c8 is likely worth the switch from tape & tap.
I would suggest going with node:test instead as Node >=16 is what should be targeted going forward, see: #278
+1 on moving to a runtime solution though I don't have the bandwidth to do it myself.
For reference, I did this over here for another project: https://github.com/yikesable/fastify-acl/commit/7871e87b14893fb892268bc8358449a3b0dbaa6f