Skip to content

commercetest/mocha-in-browser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mocha In the Browser

A super simple example of how Mocha tests can be executed in the browser.

Getting started

Clone this project and open up the test/index.html file in a browser to see the tests run.

Integrating it into your project

Copy the test directory into your project. Make sure the test/index.html file has all the right paths.

Running the tests

screenshot of the test results

Running the demonstration tests currently involves several simple steps (you're welcome to optimise the steps, etc.), i.e.

  • Install the node packages
  • run npx http-server . -o -p 9990 the local server should start and your default browser opens a new tab for: http://127.0.0.1:9990/ that lists various local folders.
  • Navigate to http://127.0.0.1:9990/test/ in your browser tab e.g. by clicking on the test folder/directory listed.
  • 4 tests should automatically run and pass (this happens so quickly you're likely to just see the results of the test run).

About

Running Mocha tests directly in the browser - forked to update so this runs in 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 75.8%
  • HTML 24.2%