Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dna-engine/load-web-page-jsdom-mocha

Minimal example of loading a web page into jsdom and testing with Mocha
https://github.com/dna-engine/load-web-page-jsdom-mocha

example javascript jsdom localhost mocha nodejs testing url

Last synced: about 1 month ago
JSON representation

Minimal example of loading a web page into jsdom and testing with Mocha

Awesome Lists containing this project

README

        

# load-web-page-jsdom-mocha
logo

_Minimal example of loading a web page into jsdom and testing with Mocha_

[![Build](https://github.com/dna-engine/load-web-page-jsdom-mocha/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/dna-engine/load-web-page-jsdom-mocha/actions/workflows/run-spec-on-push.yaml)

### Instructions
Execute `spec-runner.sh.command` or enter the terminal commands:
```shell
$ git clone https://github.com/dna-engine/load-web-page-jsdom-mocha
$ cd load-web-page-jsdom-mocha
$ npm install
$ npm test #runs "mocha spec.js"
```

For development testing, set the `url` variable in **spec.js** to your local web server, such as:
`http://localhost:8080`

screenshot

### Comparison
For a Puppeteer version, check out:

[load-web-page-puppeteer-mocha](https://github.com/dna-engine/load-web-page-puppeteer-mocha)

---
[dna-engine.org](https://dna-engine.org) | [MIT License](LICENSE.txt)