Simple test runner with TDD like assertion library for the browser.
- Tests run serially (easier debugging)
- Async test support (never hangs out)
- Custom reporters support
- TDD like interface with only few assertions
- Reports test durations
- Make sure you have node.js installed
> cd path/to/assertiz
> npm install gulp -g
> npm install
> gulp
assertiz.min.css
andassertiz.min.js
will be placed in thebuild
directory
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>assertiz</title>
</head>
<body>
<link rel="stylesheet" href="assertiz.min.css">
<script src="assertiz.min.js"></script>
<div id="assertiz"></div>
<script src="tests.js"></script>
</body>
</html>
// tests.js
var assertiz = require('assertiz');
var assert = require('assert');
var flat = require('flat');
var suite = assertiz.suite;
var test = assertiz.test;
suite('Test Suite', function () {
test('Synchronous test', function () {
assert.true(true);
});
test('Asynchronous test', function (done) {
setTimeout(function () {
assert.equal(1, 1);
done();
}, 100);
}, true);
});
flat.init(assertiz);
assertiz.run();
========
This project is not intended to serve as production level JavaScript test runner / testing framework. My goal was to create simple test runner and TDD like assertion library with clean and (as already mentioned) really simple API that I could use for personal projects. If you need robust framework with a lot of features, use Mocha or QUnit instead.