This document describes how to set up your development environment to build and test LokiDB.
See the contribution guidelines if you'd like to contribute to LokiDB.
Before you can build and test LokiDB, you must install and configure the following products on your development machine:
-
Git and/or the GitHub app (for Mac or Windows); GitHub's Guide to Installing Git is a good source of information.
-
Node.js, (version
>=7.0.0
) which is used to run tests and generate distributable files. We also use Node's Package Manager,npm
(version>=4.0.0
), which comes with Node. Depending on your system, you can install Node either from source or as a pre-packaged bundle. -
Elasticsearch which is used to unit test LokiDB's full text search.
To run tests:
$ npm run test # Run all LokiDB tests
$ npm run test:web # Run tests only in web browser
$ npm run test:node # Run tests only in node
All the tests are executed on our Continuous Integration infrastructure and a PR could only be merged once the tests pass.
LokiDB uses ESLint to format the source code. If the source code is not properly formatted, the CI will fail and the PR can not be merged.
You can check that your code is properly formatted and adheres to coding style by running:
$ npm run lint
You can automatically format your code by running:
$ npm run lint:fix
To build LokiDB, run:
$ npm run build