Truenit
Truenit (/ˈtruːnɪt/
) is a lightweight, easy-to-use, dependency-free Javascript unit testing library with a simple, yet powerful API.
When should I use Truenit?
- You want to execute your tests locally during development with a CLI (command line interface).
- You want to execute your tests on every save on a continuous integration server.
- You want to use RequireJS or Node or anything else for your source files.
Installation
truenit
is available on npm. To install it and its dependencies, run:
$ npm install truenit --save-dev
Usage
1. Import the library in your test file:
const truenit = ;
2. Register tests with functions that test your test.
// Registers a test to be tested later so that the output is aligned.truenit; // Registers a test that should throw an error.truenit;
3. Run the tests and the file.
truenit.start();
4. Enjoy the output.
$ npm test Testing all... Testing Module1... Passed. Testing Module2... Passed. Testing Node... Passed. Testing ScreenView... Passed. Testing Property... Passed. Testing OtherClass... Passed. Testing S... Passed. All tests passed! $ _
Individual tests
You can also individually test one at a time:
// Tests immediately when called, but doesn't align the result with other tests.truenit; // Tests immediately that the function errors.truenit;
Documentation
- API Model for a full comprehensive documentation of the entire API.
- Truenit Test File for an example.
- Implementation Notes for future developers.
- New Release Guide
- Code Style Guideline
Get Involved
Contact me via email.
Help improve truenit by creating a New Issue.
Copyright © 2019 Brandon Li. All Rights Reserved. | See the LICENSE