Skip to content

OpenMicroStep/Tests.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSTests for Javascript

This is a very simple javascript testing tool that brings microstep declarative test definition and execution to Javascript.

Install: npm install @openmicrostep/tests

Each test module declare a name and either a test function or a list of test modules. Named function can be directly used as test module.

If a test function takes one parameter, it's considered asynchronous and the first argument will be a Flux as defined in @openmicrostep/async npm module.

Exemple:

module.exports = {
    name: "mytestsuite",
    tests: [
        { name: "my test", test: function() {
            // run mytest
        },
        { name: "my test subs", tests: [ ... ] },
        function direct_named_test() {
            // run direct_named_test
        },
        function direct_async_test(flux) {
            flux.continue();
        }
    ]
}