1.0.12 • Published 7 years ago

weavver-moksha v1.0.12

Weekly downloads
14
License
MIT
Repository
bitbucket
Last release
7 years ago

Weavver Moksha for NodeJS is a unit testing harness that runs tests constantly on the server while providing a nice web front end to view the test status via express and angularjs

Check out the demo here: https://demo.weavver.com/moksha/

To load the harness into your project do:

npm install weavver-moksha

then in your app.js:

var moksha = require('weavver-moksha');
var global = {
     port: 3080,
     files: ['./tests/example1.js',
          './tests/example2.js']
};
moksha.init(global);

your test files are very flexible, moksha passes in a "global" object that gives you access to its internals.

use the global object to insert tests into the queue:

// example1.js:
exports.init = function (global) {

     console.log('initializing test 1');

     global.unitsets.push({
          name: 'testset1',
          items: [{
               name: 'dividebyzero',
               description: 'trying to divide by zero',
               interval: '* * * * *', // use cron syntax
               tags: '', // not used for now
               code: function (item, callback) {
                    console.log('test');
                    callback(); // when you're done and the test passes successfully
                    // otherwise throw a javascript error for a failure
               }
          }]
     });

};
1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago