From c3daf919cefe1dccba96afe3310c3f1372acfafa Mon Sep 17 00:00:00 2001 From: Madhusudhan Srinivasa Date: Thu, 14 Mar 2019 16:15:11 +0100 Subject: [PATCH] update readme --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c56c5b5e..a9bf98b2 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,13 @@ If you make any changes to the file, nodemon should automatically pick up and re To run tests ```sh -$ docker-compose exec node npm test +$ docker-compose exec -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm test ``` +Note that we are overriding the environment variable set in `.env` file because we don't want our data erased by the tests. + +Note: The difference between exec and run is that, exec executes the command within the running container and run will spin up a new container to run that command. So if you want to run only the tests without docker-compose up, you may do so by running `docker-compose run -e MONGODB_URL=mongodb://mongo:27017/my_app_test node npm test` + ## License MIT