A super simple example of how Mocha tests can be executed in the browser.
Clone this project and open up the test/index.html file in a browser to see the tests run.
Copy the test directory into your project. Make sure the test/index.html file has all
the right paths.
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 9990the 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
testfolder/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).
