standard-engine icon indicating copy to clipboard operation
standard-engine copied to clipboard

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

Open voxpelli opened this issue 4 years ago • 12 comments

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.

voxpelli avatar Nov 29 '21 14:11 voxpelli

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.

theoludwig avatar Nov 29 '21 15:11 theoludwig

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 avatar Nov 29 '21 16:11 voxpelli

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

voxpelli avatar Nov 30 '21 10:11 voxpelli

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

LinusU avatar Nov 30 '21 10:11 LinusU

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 avatar Nov 30 '21 10:11 voxpelli

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

voxpelli avatar Nov 30 '21 10:11 voxpelli

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

mcollina avatar Nov 30 '21 11:11 mcollina

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

voxpelli avatar Nov 30 '21 11:11 voxpelli

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.

mcollina avatar Nov 30 '21 11:11 mcollina

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

voxpelli avatar May 30 '23 17:05 voxpelli

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

bcomnes avatar Jun 21 '23 15:06 bcomnes

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

voxpelli avatar Jun 21 '23 18:06 voxpelli