pg-pool-mocker
v0.1.0
Published
pg-pool-mocker is a nodejs tool to mock a node pg pool
Downloads
2
Readme
pg-pool-mocker
pg-pool-mocker is a nodejs tool to mock a node pg pool.
Installation
You can download the repository or simply install this module through npm:
npm install pg-pool-mocker
Usage
Include the module through import
:
import { initPool } from 'pg-pool-mocker';
Then, if you need a pool mocked only create a pool as mocker pool:
const options = { mocked: true, mockedData: { ... } }
const pool = initPool(options);
options
is the pool options needed to work, if the pool is mocked, it takes the following arguments:
mocked
: is a boolean to set the pool as mocked.mockedData
: is an object with the data to return as result.