standard / standard-engine

:fire_engine: The guts of `standard` modularized for reuse
MIT License
145 stars 39 forks source link

Post Node 14: Replace `tape` with `node:test`? #277

Open voxpelli opened 2 years ago

voxpelli commented 2 years ago

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.

theoludwig commented 2 years ago

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.

voxpelli commented 2 years ago

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

voxpelli commented 2 years ago

Similar move: https://github.com/hypercore-protocol/hypercore-next/pull/39

LinusU commented 2 years ago

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

voxpelli commented 2 years ago

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

voxpelli commented 2 years ago

Found the thread I remembered on Twitter with eg. @mcollina: https://twitter.com/matteocollina/status/1447973242581524486

mcollina commented 2 years ago

I cannot move any of my repositories until I have to support Node v12.

voxpelli commented 2 years ago

@mcollina But you will after Node 12 has left LTS in about six months time?

mcollina commented 2 years ago

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.

voxpelli commented 1 year ago

I would suggest going with node:test instead as Node >=16 is what should be targeted going forward, see: #278

bcomnes commented 1 year ago

+1 on moving to a runtime solution though I don't have the bandwidth to do it myself.

voxpelli commented 1 year ago

For reference, I did this over here for another project: https://github.com/yikesable/fastify-acl/commit/7871e87b14893fb892268bc8358449a3b0dbaa6f