1.4.8 • Published 11 years ago
browser-mocha v1.4.8
browser-mocha
run browser mocha test by web driver
Installation
npm install browser-mochaTry
try it by node demo.js, remember to open phantomjs web driver (phantomjs -w) before try

Usage
basic usage
var browserMocha = require('browser-mocha')
browserMocha('some mocha code', {ui: 'bdd'}, function(err, data) {
browserMocha.print(data.logs)
})data is some of mocha runner value
logsarray of print logs, can usebrowserMocha.printprint to stdouttotalcount of test casesfailurescount of failure test cases
Advanced
Test page will default add es5-shim, use {shim: false} to close it
Get script by browserMocha.getScript for custom debug
Options
Use more options like below
browserMocha('mocha code', {
ui: 'bdd'
, reporter: 'spec'
, timeout: '3000' // mocha timeout
, host: 'localhost:8910' // webdriver host, default is this
, title: 'my test' // page test
, shim: true // add es5-shim, default true
, browser: {
name: 'chrome'
, version: '31'
, platform: 'linux'
}
}, callback)License
ISC