This document describes how to set up your development environment and run TypeORM test cases.
See the contribution guidelines if you'd like to contribute to Angular.
Before you can build and test TypeORM, 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, (better to install latest version) which is used to run a development web server, run tests, and generate distributable files. Depending on your system, you can install Node either from source or as a pre-packaged bundle.
- Mysql is required to run tests on this platform (or docker)
- MariaDB is required to run tests on this platform (or docker)
- Postgres is required to run tests on this platform (or docker)
- Oracle is required to run tests on this platform
- Microsoft SQL Server is required to run tests on this platform
- For MySQL, MariaDB and Postgres you can use docker instead (docker configuration is here)
Fork and clone the repository:
- Login to your GitHub account or create one by following the instructions given here.
- Fork the main TypeORM repository.
- Clone your fork of the TypeORM repository and define an
upstream
remote pointing back to the TypeORM repository that you forked in the first place.
# Clone your GitHub repository:
git clone git@github.com:<github username>/typeorm.git
# Go to the TypeORM directory:
cd typeorm
# Add the main TyepORM repository as an upstream remote to your repository:
git remote add upstream https://github.com/typeorm/typeorm.git
Install all TypeORM dependencies by running this command:
npm install
During installation you may have some problems with some dependencies. For example to proper install oracle driver you need to follow all instructions from node-oracle documentation.
Also install these packages globally:
npm install -g gulp
(you might need to prefix this command withsudo
)npm install -g typescript
(you might need to prefix this command withsudo
)
To build a distribution package of TypeORM run:
gulp package
This command will generate you a distribution package in the build/package
directory.
You can link (or simply copy/paste) this directory into your project and test TypeORM there
(but make sure to keep all node_modules required by TypeORM).
Setup your environment configuration by copying ormconfig.json.dist
into ormconfig.json
and
replacing parameters with your own.
Then run tests:
npm test
You should execute test suites before submitting a PR to github. All the tests are executed on our Continuous Integration infrastructure and a PR could only be merged once the tests pass.
To run your tests you need dbms installed on your machine. Alternatively, you can use docker
with all dbms images inside it. To use dbms for your tests from docker simply run docker-compose up
in the root of the project. Once all images are fetched and run you can run tests.