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)
- Host: GitHub
- URL: https://github.com/luispedro/fragile
- Owner: luispedro
- License: mit
- Created: 2011-04-21T13:51:07.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-04-21T14:17:57.000Z (about 15 years ago)
- Last Synced: 2025-01-19T06:43:42.616Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://twitter.com/luispedrocoelho
- Size: 869 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
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
