Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mocha-testing-skeleton

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-testing-skeleton

Simple testing skeleton for running mocha + expect.js unit tests in the browser.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Mocha Testing Skeleton

This repo demonstrates how to run mocha + expect.js unit tests in the browser (or headlessly), with tests written in BDD (Behavior Driven Development) style.

Dependencies:

  • mocha - a JavaScript test framework for running tests on Node.js and the browser
  • expect.js - a small BDD-style assertion library
  • mocha-phantomjs - a PhantomJS test runner for running browser tests headlessly

Included files:

  • main.js - the code under test
  • test/index.html - an HTML page that sets up the test infrastructure and enables you to run the tests.
  • test/tests.js - the mocha test suite. The functions "describe()" and "it()" and "afterEach()" are part of mocha; the "expect()" functions are assertion functions that come from expect.js.

Based upon this repo. Altered to meet my needs.

Installing

  1. Install Node.js and npm from NodeJS.org.
  2. Use git to clone this repo on your local machine:
$ git clone https://github.com/mjhea0/mocha-testing-skeleton.git
  1. Enter the repo directory and type make install. This installs the dependencies listed above.

Running the tests manually from a browser

  1. Open the test/index.html file in a browser. This displays a test page that shows two tests passing.
  2. Simply refresh the page to run the test suite again.

Running the tests headlessly using PhantomJS

  1. Run make test and observe the results on the command line.

Keywords

FAQs

Package last updated on 20 Nov 2013

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