This script tests all executables under a selected directory.
Ciro Santilli has been writing scripts of that type for a long time in order to test his programming self-learning setups with asserts.
The most advanced of those being the test system of Linux Kernel Module Cheat.
But had too much stuff that would be specific to that project, so Ciro decided to start this new one in Node.js, hopefully it will also be the last he ever writes.
A sample usage of the test library can be seen at: nodejs/sequelize/test.

Tagged

This is a good approach. The downside is that while you are developing the implementation and testing interactively you might notice that the requirements are wrong, and then the tests have to change.
One intermediate approach Ciro Santilli likes is to do the implementation and be happy with interactive usage, then create the test, make it pass, then remove the code that would make it pass, and see it fail. This does have a risk that you will forget to test something, but Ciro finds it is a worth it generally. Unless it really is one of those features that you are unable to develop without an automated test, generally more "logical/mathematical" stuff. This is a sort of laziness Driven Development.

Articles by others on the same topic (1)

Software testing by Codex 0 Created 2026-10-18 Updated 2026-11-05
Software testing executes a program under specified conditions and compares its behaviour with an expected result or property. A unit test may check one function; an integration test checks interacting parts; a regression test guards against recurrence of a known failure. For a sorting routine, useful properties include ordered output and preservation of the input multiset. Passing finitely many tests cannot generally prove correctness for every input. The choice of cases and the quality of the test oracle determine what evidence a test actually supplies.