testlite
Easy, lightweight testing
Example Usage
// add.js module { return num1 + num2}; // tests/addTest.js const assert = ;const add = ;moduleexports = 'exports' : { assert; assert; } { assert; assert; assert; } ; // tests/test.js const tl = ;;tl;
Note that it is extremely important to call tl.test()
or else nothing will happen.
API
require('testlite'): Function
- the function to create a test.testName: String
- the high-level name of the test, ex.Array
.testTests: Object
- the tests.- The key is the lower-level name of the test, ex.
indexOf()
. - The value is an object.
- The key is the name of the test, ex.
should return -1 when element is not found
- The value is a function that test this functionality.
- returns
- Nothing, if the test is synchronous.
- If the test is asynchronous, a promise. A promise that resolves means success, a promise that rejects means failure.
- returns
- The key is the name of the test, ex.
- The key is the lower-level name of the test, ex.
require('testlite').test: Function
- the function to be called to start testing.