npm.io
1.3.3 • Published 5 years ago

jest-pg

Licence
MIT
Version
1.3.3
Deps
4
Size
6 kB
Vulns
1
Weekly
0
Stars
1

jest-pg

Create postgres database scheme for each test and delete the database after test using jest globalSetup/globalTeardown.

NOTE: typeorm is used

Configuration

This uses TYPEORM configuration from environment variables. You can put it in a .env file or specify TYPEROM_* when running jest

Usage

jest.config.js

...
globalSetup: "jest-pg/src/setupDatabase",
globalTeardown: "jest-pg/src/teardownDatabase",
...