utest
The minimal unit testing library.
Why yet another test library?
I wanted something simple, that just does unit tests (no async) and where each test is a standalone UNIX program. Now it exists.
How do I run async tests?
Currently there is only one sane way: Do not use a framework. Instead use one file per test.
If that becomes an issue, you should write more unit tests. (It is not a unit test if it does I/O).
Install
npm install utest
Usage
Running a test with utest is very simple:
var test = ;var assert = ; ;
It is also possible to define a before/after method:
var test = ;var assert = ; ;
Last but not least, you can run individual tests by prefixing them with an exclamation mark. This is useful when putting debug statements into the subject under test:
var test = ;var assert = ; ;
Future Features
I want to keep this library as minimal as possible, but I do consider the addition of the following features:
- Nested test cases
- TAP output (if TAP=1 in the environment, switch to TapReporter class)
- Leak detection (automatically add a final test that fails if there are global leaks).
License
This module is licensed under the MIT license.