wildpeaks / 2020-example-browser-tests

[ARCHIVED] Example showing tests running directly in a browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JS Tests: Legacy

Option 1: run entirely in the browser.

It runs an arbitrary script in a page, and a human looks at the page to see if the result is what is expected. It's not fully automated (so you can't use that in Github Actions), but at least it gives an easy red/green status.

You can use a library like QUnit to structure the tests.

This kind of test isn't really used anymore (because they depend on a human opening the browser and reading the results), but it was the only option for a very long time, and the advantage is this works in very old browsers (and BSContact).

The other options:


Run the tests

Start a webserver to serve the files as http://localhost.

Then open http://localhost/test/index.html in your browser to see the result: green means pass, red means fail.

About

[ARCHIVED] Example showing tests running directly in a browser

License:MIT License


Languages

Language:HTML 52.0%Language:JavaScript 48.0%