New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

browser-mocha

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-mocha

run browser mocha test by web driver

  • 1.4.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21
increased by425%
Maintainers
1
Weekly downloads
 
Created
Source

browser-mocha

Build status NPM version Downloads

run browser mocha test by web driver

Installation

npm install browser-mocha

Try

try it by node demo.js, remember to open phantomjs web driver (phantomjs -w) before try

demo

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

  • logs array of print logs, can use browserMocha.print print to stdout
  • total count of test cases
  • failures count 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

Keywords

FAQs

Package last updated on 16 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc