From 822ffc797439a3417ceb6d0b73ba568f7b276a9a Mon Sep 17 00:00:00 2001 From: Agnes Lin Date: Mon, 8 Jun 2020 12:05:49 -0400 Subject: [PATCH] fix: fix sections order --- README.md | 122 +++++++++++++++++++++++++++--------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 9df6243b2..c041eaf3c 100644 --- a/README.md +++ b/README.md @@ -249,67 +249,6 @@ The .loopbackrc file is in JSON format, for example: -## Running tests - -### Own instance - -If you have a local or remote MongoDB instance and would like to use that to run the test suite, use the following command: - -- Linux - -```bash -MONGODB_HOST= MONGODB_PORT= MONGODB_DATABASE= CI=true npm test -``` - -- Windows - -```bash -SET MONGODB_HOST= SET MONGODB_PORT= SET MONGODB_DATABASE= SET CI=true npm test -``` - -### Docker - -If you do not have a local MongoDB instance, you can also run the test suite with very minimal requirements. - -- Assuming you have [Docker](https://docs.docker.com/engine/installation/) installed, run the following script which would spawn a MongoDB instance on your local: - -```bash -source setup.sh -``` - -where ``, `` and `` are optional parameters. The default values are `localhost`, `27017` and `testdb` respectively. - -- Run the test: - -```bash -npm test -``` - -### Leak detection - -Tests run for 100 iterations by default, but can be increased by setting the -env var `ITERATIONS`. - -``` -make leak-detection # run 100 iterations (default) -``` - -or - -``` -ITERATIONS=1000 make leak-detection # run 1000 iterations -``` - -## Running benchmarks - -**Benchmarks must be run on a Unix-like operating system.** - -``` -make benchmarks -``` - -The results will be output in `./benchmarks/results.md`. - ## Handling ObjectId MongoDB uses `ObjectId` for its primary key, which is an object instead of a @@ -491,6 +430,67 @@ export class User extends Entity { {% include important.html content="Since in MongoDB `_id` is reserved for the primary key, LoopBack **does not** allow customization of the field name for the id property. Please use `id` as is. Customizing the id property would cause errors." %} +## Running tests + +### Own instance + +If you have a local or remote MongoDB instance and would like to use that to run the test suite, use the following command: + +- Linux + +```bash +MONGODB_HOST= MONGODB_PORT= MONGODB_DATABASE= CI=true npm test +``` + +- Windows + +```bash +SET MONGODB_HOST= SET MONGODB_PORT= SET MONGODB_DATABASE= SET CI=true npm test +``` + +### Docker + +If you do not have a local MongoDB instance, you can also run the test suite with very minimal requirements. + +- Assuming you have [Docker](https://docs.docker.com/engine/installation/) installed, run the following script which would spawn a MongoDB instance on your local: + +```bash +source setup.sh +``` + +where ``, `` and `` are optional parameters. The default values are `localhost`, `27017` and `testdb` respectively. + +- Run the test: + +```bash +npm test +``` + +### Leak detection + +Tests run for 100 iterations by default, but can be increased by setting the +env var `ITERATIONS`. + +``` +make leak-detection # run 100 iterations (default) +``` + +or + +``` +ITERATIONS=1000 make leak-detection # run 1000 iterations +``` + +## Running benchmarks + +**Benchmarks must be run on a Unix-like operating system.** + +``` +make benchmarks +``` + +The results will be output in `./benchmarks/results.md`. + ## Release notes - 1.1.7 - Do not return MongoDB-specific `_id` to client API, except if specifically specified in the model definition