0.3.2 • Published 2 years ago

@tim-code/jest-config-server v0.3.2

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
2 years ago

jest-config-server

npm install @tim-code/jest-config-server

A companion library to server, this allows the server to be run as part of Jest tests.

Usage

Usage in including project:

// jest.config.js
import config from "@tim-code/jest-config-server"

export default {
  ...config,
}

Example test command in package.json:

"test": "ROUTES_DIR=backend node --no-warnings --experimental-vm-modules node_modules/.bin/jest",

Environment Variables

PORT: the port to use for the test server; Node randomly assigns an available one by default or if PORT is 0

By using a random port, multiple test suites can run in parallel and there is no worry about asking for a port that is already in use.

ROUTES_DIR: the directory to provide to the server during global setup

Additionally:

process.env.PORT is set after the server has been started to the port used to start the server.

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.2

2 years ago

0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago