Skip to content

pg-pool-mocker is a nodejs tool to mock a node pg pool

License

Notifications You must be signed in to change notification settings

lammoth/pg-pool-mocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

pg-pool-mocker is a nodejs tool to mock a node pg pool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published