pg-pool-mocker is a nodejs tool to mock a node pg pool.
You can download the repository or simply install this module through npm:
npm install pg-pool-mockerInclude 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.