rxtestrunner

0.0.4 • Public • Published

Minimal reactive test runner for JavaScript

This library is experimenal

I was looking for a simple test runner that also works in PhantomJS scripts but could not find any. This is a minimal test runner build using reactive streams (also called Observables). You are free to use any assertion library. Testing of asynchronous can be managed with any promise library.

Here is an example of how it is used usage:

var assert = ( typeof phantom === 'object' && require('chai').assert ) ||
             ( typeof process === 'object' && require('assert') ) ||
             console.assert;

var TestObservable = require('rxtestrunner');

test1 = function() {
  assert.ok(true, 'this should not throw an error');
  assert.ok(false, 'this should throw an error');
};

test2 = function() {
  assert.ok(true, 'this should not throw an error');
  assert.ok(false, 'this should throw an error');
};

(TestObservable.test(test1))
.merge(TestObservable.test(test2))
  .map(TestObservable.basicFormat)
  .map(console.log.bind(console))

Suggestions and contributions and welcome

Just create github issue of pull request.

License

MIT

Package Sidebar

Install

npm i rxtestrunner

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • colmsjo