Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evanshortiss/nodejs-testing-examples
Examples of testing Node.js modules and express applications
https://github.com/evanshortiss/nodejs-testing-examples
Last synced: 21 days ago
JSON representation
Examples of testing Node.js modules and express applications
- Host: GitHub
- URL: https://github.com/evanshortiss/nodejs-testing-examples
- Owner: evanshortiss
- Created: 2015-10-13T17:51:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T11:08:31.000Z (7 months ago)
- Last Synced: 2024-04-09T13:09:28.990Z (7 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Node.js Testing Examples
========================As the name implies, this repository contains examples on how you can test
Node.js codebases.Each folder contains a README giving a quick overview of the different testing
types and the tools they use, but a quick breakdown of this repo is provided
below.## Setup
Before you can use this be sure to _cd_ into this repo directory and run:```
npm install
```## Basic Module Testing
This demonstrates how you could setup your own test cases using Node.js without
installing any test frameworks or dependencies.Run example tests using the command:
```
npm run basic-test
```## Module Testing with Mocha and Chai
These tests are very similar to the _Basic Module Testing_, and even test the
same module, but instead use Mocha as a test framework and Chai for assertions
since these provide more expressive and easy to read tests.Run example tests using the command:
```
npm run mocha-test
```## Express Application Testing
Express is a popular web application framework for Node.js. Developers expose
routes using Routers (express.Router instaces) mounted to an express instance.
Testing these can be achieved using the supertest module without ever needing
to actually have your express application bind to a port.Run example tests using the command:
```
npm run express-test
```