GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ludofischer/mocha-chai-browser-demo: An example setup for unit testing JavaScript in the browser with the Mocha testing framework and Chai assertions

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
test-lib
test-lib
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
karma.conf.js
karma.conf.js
 
 
mocha.css
mocha.css
 
 
package.json
package.json
 
 
test.html
test.html
 
 
tests.js
tests.js
 
 
utils.js
utils.js
 
 

Repository files navigation

A demo setup for unit testing client-side JavaScript code with Mocha.js and Chai.js.

Since mocha 1.2, you can install mocha via npm and run mocha init <path> to generate a client side testing skeleton.

Automated in-browser tests with Karma

This sample also includes a Karma configuration to run the tests automatically.

To use Karma, you need to have node.js and npm installed. In the project directory, type npm install karma-mocha. After the Karma install finishes, type node_modules/karma/bin/karma start and navigate to http://localhost:9876 to let Karma capture the web browser and run the tests automatically.

If you are familiar with npm, you can look at the package.json. That configuration allows you to just type npm install and then npm test to start the Karma server. Since the karma NPM package does not define a bin field, we must make use of the karma-cli package to be able to use the karma executable inside our test script.

About

An example setup for unit testing JavaScript in the browser with the Mocha testing framework and Chai assertions

Resources

Readme
MIT license
Activity

Stars

41 stars

Watchers

1 watching

Forks

12 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.