Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axfab/niut
Minimalist testing framework
https://github.com/axfab/niut
Last synced: about 2 months ago
JSON representation
Minimalist testing framework
- Host: GitHub
- URL: https://github.com/axfab/niut
- Owner: AxFab
- Created: 2016-10-01T08:53:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-01T09:06:51.000Z (over 8 years ago)
- Last Synced: 2024-11-14T20:47:12.710Z (2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node Integrated Unit-Tests
The test suite framework you wouldn't like.
Niut is a small framework for unit test on node environment.
He's based on the idea less is more.
It's big advantage been it's really small size.## Usage
Niut is a simple library which hold in a single script page. You can also
download it from npm, this library doesn't have any dependencies.npm install niut
## Test suite
my-suite.js
```js
var niut = niut || require ('niut'),
suite = niut.newSuite('My Test Suite');(function () {
suite.test('Mon Test', function (assert, done) {
assert.isTrue(true);
done();
});})();
if (typeof module !== 'undefined' && module.exports) {// Node.js
module.exports = Validator;if (require.main === module) {
niut.runner(suites, function(echec) {
if (echec) throw new Error('CheckMate...');
});
}
}
```runner.js
```js
var suites = {
'./my-suite.js',
require('./my-second-suite.js')
};require('niut').runner(suites, function(echec) {
if (echec) throw new Error('CheckMate...');
});
```