An open API service indexing awesome lists of open source software.

https://github.com/luispedro/fragile

Lightweight command line unit testing tool for nodejs (with coffescript support)
https://github.com/luispedro/fragile

Last synced: 6 months ago
JSON representation

Lightweight command line unit testing tool for nodejs (with coffescript support)

Awesome Lists containing this project

README

          

Fragile
=======

Fragile is a very lightweight command line unit testing tool for nodejs.
Please note that fragile is not a unit testing framework, it only reports
your tests to console. If you need rather advanced unit testing framework
go for [nodeunit](http://github.com/caolan/nodeunit)

Sample test case:

// test-example.js

var assert = require('assert'),
fs = require('fs');

exports.setup = function (done) {
this.foo = 'bar';
done();
};

exports.testSync1 = function (done) {
assert.strictEqual('123', 123, "This must fail with this assertion message");
done();
};

exports.testAsync1 = function (done) {
var self = this;
fs.readFile('./foo', function (err, data) {
if (err) assert.fail(err);
assert.ok(data);
assert.equal(self.foo, data.toString());
done();
});
};

exports.teardown = function (done) {
// throw new Error('Something went wrong');
delete this.foo;
done();
};

Test the file simply typing commands below.

> npm install fragile
> fragile test-example.js

A sample multi-test case report displayed below

![Screenshot](http://kadirpekel.com/fragile.png)