Skip to content

qt911025/co-mocha-nightwatch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A fork from Co Mocha

Enable support for generators in Mocha (built in versoin of Nightwatch.js) tests using co.

Use the --harmony-generators flag when running node 0.11.x to access generator functions, or transpile your tests using traceur or regenerator.

Installation

npm install co-mocha-nightwatch --save-dev

Usage

Just require the module in your tests and start writing generators in your tests.

require('co-mocha-nightwatch')
it('should do something', function * (cilent) {
  yield users.load(123)
})

DON'T use require option of test_runner in nightwatch configuratoin file, because this option can only be used in command line of mocha.

Node

Install the module using npm install co-mocha-nightwatch --save-dev. Now just require the module to automatically monkey patch any available mocha instances. With mocha, add require('co-mocha') inside your main test file.

If you need to monkey patch a different mocha instance you can use the library directly:

var mocha = require('mocha-nightwatch')
var coMocha = require('co-mocha-nightwatch')

coMocha(mocha)

About

co-mocha adapter for Nightwatch.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%