tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 307 forks source link

RFE: Document use with TypeScript #574

Closed FGasper closed 2 years ago

FGasper commented 2 years ago

It would be handy if a section could be added to the README about use from TypeScript.

Something along the lines of this example, maybe?

ljharb commented 2 years ago

I don’t think that’s necessary. A typescript user should already know how to use ts-node with everything if needed, and the advice isn’t different with tape than with anything else. It’s not incumbent on “every individual non-typescript package” to make typescript easy to use; that’s typescript’s task.

FGasper commented 2 years ago

Not necessary, no, but it’s a common use case, and projects often try to make such things as easy as possible.

Not every TS user knows about ts-node; I just learned about it today. ;-) (I’m no TypeScript wizard, but I’ve used it several times.)

ljharb commented 2 years ago

Sure, but an alternative without ts-node is to transpile first and test the output.

This is just the sort of thing that you open yourself to by making the choice to use “not JavaScript”, and it’s not practical for millions of individual JS packages to try to document all the caveats you need to know when making that choice.

FGasper commented 2 years ago

TypeScript seems rather “special” among “non-JavaScript”s by its popularity’s virtue, but hey.

Anyhow, thank you for maintaining tape. I’ve always enjoyed using it.