tjfontaine / native-dns-packet

DNS parsing and writing in javascript
MIT License
58 stars 36 forks source link

Change testing framework #9

Open taoeffect opened 10 years ago

taoeffect commented 10 years ago

I'm not too big of a fan of the current testing framework being used (don't like its output). There are some other ones that seem to have far wider adoption and support, more features, better documentation, and more readable output:

Thoughts on the above?

tjfontaine commented 10 years ago

The important parts of any test suite is that it's easy to isolate and debug a regression. My problem with most of the test suites and harnesses is that they make it near impossible to just test that regression.

The output from tap is specifically nice though because it makes it easy to programmatically manipulate results. While most other runners can output in tap format, things like vows and mocha are quite intrusive to the the node environment and perform things that I consider particularly evil to achieve their test running.

That being said, it should be reasonably easy to write a decent test runner for this that iterates files and compares parsing and serialization, that doesn't require any 3rd party dependency.

kmpm commented 9 years ago

Have a look at https://github.com/hapijs/lab if you don't like global manipulation. I like the fact that you can get tap (and other output formats) as well as a fairly decent code coverage report.

lab is a simple test utility for node. Unlike other test utilities, lab uses domains instead of uncaught exception and other global manipulation. Our goal with lab is to keep the execution engine as simple as possible, and not try to build an extensible framework.