Skip to content

avbel/co-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

co-lab

Build

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();
  });
});

About

Lab tests with power of ES6 generators and co

Resources

Stars

Watchers

Forks

Packages

No packages published