Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregjopa/express-app-testing-demo
a simple express app for demonstrating testing and code coverage
https://github.com/gregjopa/express-app-testing-demo
express javascript jest nodejs testing
Last synced: 23 days ago
JSON representation
a simple express app for demonstrating testing and code coverage
- Host: GitHub
- URL: https://github.com/gregjopa/express-app-testing-demo
- Owner: gregjopa
- Created: 2014-02-18T03:30:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:32:43.000Z (almost 2 years ago)
- Last Synced: 2023-03-11T15:11:32.968Z (over 1 year ago)
- Topics: express, javascript, jest, nodejs, testing
- Language: HTML
- Homepage: http://express-app-testing-demo.herokuapp.com/
- Size: 960 KB
- Stars: 95
- Watchers: 5
- Forks: 110
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# express-app-testing-demo
This project is a simple express app for demonstrating testing and code coverage.
[Jest](https://facebook.github.io/jest/) and
[Supertest](https://github.com/visionmedia/supertest) are used for testing.
Jest is also used for mocking functions and measuring code coverage.
Note that this app only focuses on server-side JavaScript testing.## Requirements
* Node.js - [https://nodejs.org/](https://nodejs.org/)
## Getting Started
* Clone the repo
* Install dependencies with `npm install`
* Run server with `npm start` and go here:
[http://localhost:3000/](http://localhost:3000/)## Running Tests
* Run unit and integration tests: `npm test`
* Run end-to-end tests: `npm run test:e2e`## Code Coverage Report
A new code coverage report is generated every time `npm test` runs.
Normally this coverage report is ignored by git.
This project includes it in source control so the coverage report can be viewed in the demo app:
[http://express-app-testing-demo.herokuapp.com/coverage/lcov-report/index.html](http://express-app-testing-demo.herokuapp.com/coverage/lcov-report/index.html)