Skip to content

Testing

Vitaly Tomilov edited this page May 20, 2018 · 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

TSLint

If you are making changes to the TypeScript part of the library, make sure to run this:

$ npm run tslint
Clone this wiki locally