co-lab
v0.0.1
Published
It allows to use ES6 generators (co-powered) inside lab's tests
Downloads
4
Readme
co-lab
This module lets you use powered by co generators inside lab tests. Node 0.11+ is required.
Install
$ npm install co lab co-lab
Usage
Use inside tests
let Lab = require("co-lab");
instead of
var Lab = require("lab");
See a demo bellow to see abilities of this module
"use strict";
let Lab = require("co-lab");
Lab.experiment("ES6 generators", function(){
Lab.before(function*(){ //beforeEach is supported too
//some preparations here
});
Lab.after(function*(){ //afterEach is supported too
//some finalizations here
});
Lab.test("my test", function*(){
//do some test here. throw an exception on error
});
Lab.test("my test2", function(done){
//general function with callback is supported too
done();
});
});