Skip to content

Testing

Vitaly Tomilov edited this page Oct 29, 2017 · 8 revisions

Testing the library

  • Clone the repository (or download, if you prefer):
$ git clone https://github.com/vitaly-t/pg-promise
  • Install the library's DEV dependencies:
$ npm install
  • Make sure all tests can connect to your local test database, using the connection details in test/db/header.js. Either set up your test database accordingly or change the connection details in that file.

  • Initialize the database with some test data:

$ node test/db/init.js
  • To run all tests:
$ npm test
$ npm run test-native
  • To run all tests with coverage:
$ npm run coverage

Documentation

To generate documentation, you can run:

$ npm run doc

ESLint

You can run all ESLint checks via the following command:

$ npm run lint
Clone this wiki locally