Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.44 KB

CONTRIBUTING.md

File metadata and controls

43 lines (30 loc) · 1.44 KB

How to contribute to Knex.js

  • Make changes in the /src directory and run npm run dev to update the files in /lib

  • Before sending a pull request for a feature or bug fix, be sure to have tests.

  • Use the same coding style as the rest of the codebase.

  • All pull requests should be made to the master branch.

Integration Tests

The Easy Way

By default, Knex runs tests against MySQL (using mysql and mysql2), Postgres, and SQLite. The easiet way to run the tests is by creating the database 'knex_test' and granting permissions to the database's default username:

  • MySQL: root
  • Postgres: postgres

No setup is required for SQLite.

Specifying Databases

You can optionally specify which dialects to test using the DB environment variable. Values shoud be space separated and can include:

  • mysql
  • mysql2
  • postgres
  • sqlite3
  • maria
  • oracle
$ DB='postgres mysql' npm test

Custom Configuration

If you'd like to override the database configuration (to use a different host, for example), you can override the path to the default test configuration using the KNEX_TEST environment variable.

$ KNEX_TEST='./path/to/my/config.js' npm test