Skip to content

Commit c3daf91

Browse files
committed
update readme
1 parent 6153edc commit c3daf91

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ If you make any changes to the file, nodemon should automatically pick up and re
5252
To run tests
5353

5454
```sh
55-
$ docker-compose exec node npm test
55+
$ docker-compose exec -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm test
5656
```
5757

58+
Note that we are overriding the environment variable set in `.env` file because we don't want our data erased by the tests.
59+
60+
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`
61+
5862
## License
5963

6064
MIT

0 commit comments

Comments
 (0)