From abc7a25cc0661ebfd53257a6c3e08a40699e7866 Mon Sep 17 00:00:00 2001 From: Eric Hwang Date: Wed, 27 Feb 2019 17:27:16 -0800 Subject: [PATCH] Add instructions for running tests --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 4b79f050..00a6bb49 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,26 @@ Mongo errors are passed back directly. Additional error codes: * 5103 -- Missing ops from requested version * 5104 -- Failed to parse query +## Running tests + +This is a database adapter for ShareDB, so all tests in this repo are +integration tests, requiring a running database. You can run one using Docker. + +```shell +# In one terminal, run a Docker container for Mongo on port 27107. +# The `--rm` means the container cleans itself up after being stopped. + +docker run --rm -p 27017:27017 mongo:latest + +# In another terminal, run the integration tests: + +npm test + +# Ctrl+C to stop the Docker container after you're done with it. +``` + +In place of the `latest` tag, you can use a specific version tag like `4.0`. +See available tags here: https://hub.docker.com/_/mongo#shared-tags ## MIT License Copyright (c) 2015 by Joseph Gentle and Nate Smith