Description
This project could scan files under the specific directory and run tests in them. The test report could be print to the terminal or pass to the caller via Callback.
Or you could setup only mode to only run all tests or specific tests a specific file.
How to use it
To run it, you first need to write test.
You could write test by yourself or use the test template and config to setup tests. Either way require the test functions to be exported and having a callback function as their parameter which will callback(testResult[, errorMessage]).
For example (Write by yourself, it also require chalk.)
const chalk = moduleexports = foo { if 1 + 1 === 2 console else console }
Or you could use test template and config,
moduleexports = foo2 const TestFunctionConfig readConfigAndRun = // in most case, this obj should be the object about to testconst obj = { if 1 + 1 === 2 console else console } { }
More Config examples
// having prerunfuncs UserLoyaltyLevels 'getLevel' levelLevelID null UserLoyaltyLevels 'addLevel' levelLevelID level null
Once you have your test functions, you can run it.
const setAndRun =
If you have any problems or anything to say, please create an issue at github respo, https://github.com/Jupiter0806/JS_Playground/tree/master/my_node_modules/jupyter-js-auto-test I will try to reply as soon as possible.