0.9.16 • Published 5 years ago
truenit v0.9.16
Truenit
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 = require( 'truenit' );
2. Register tests with functions that test your test.
// Registers a test to be tested later so that the output is aligned.
truenit.registerTest( 'Module1', () => {
// Do whatever tests here with Module1.
// Example:
truenit.notOk( 6 === 5, 'message if it fails' );
} );
// Registers a test that should throw an error.
truenit.registerThrowTest( 'Module2', () => {
// Do whatever tests here with Module2 that throws an error.
// Example:
truenit.ok( 6 === 5, 'message if it fails' );
} );
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.test( 'Module1', () => {
// Do whatever tests here with Module1.
// Example:
truenit.notOk( 6 === 5, 'message if it fails' );
} );
// Tests immediately that the function errors.
truenit.throws( 'Module2', () => {
// Do whatever tests here that should error with Module2.
// Example:
truenit.ok( 6 === 5, 'will not be called' );
} );
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
0.9.15
5 years ago
0.9.16
5 years ago
0.9.14
5 years ago
0.9.13
5 years ago
0.9.12
5 years ago
0.9.8
5 years ago
0.9.7
5 years ago
0.9.9
5 years ago
0.9.10
5 years ago
0.9.11
5 years ago
0.9.6
6 years ago
0.9.5
6 years ago
0.9.1
6 years ago
0.9.0
6 years ago
0.0.0-dev.3
6 years ago
0.0.0-dev.2
6 years ago
0.0.0-dev.1
6 years ago
0.0.0-dev.0
6 years ago
0.0.0
6 years ago