Skip to content

Commit

Permalink
test: start and stop redis with docker
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Feb 12, 2017
1 parent 5072ed0 commit 6af6b50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Expand Up @@ -81,14 +81,17 @@ Records API
Run tests
---------

Start a redis server on the default port
```bash
redis-server ./conf/redis.conf
```

Run the tests with mocha:
```bash
make test
npm run redis_start
npm test
npm run redis_stop
```

Note, the command above use a Docker container. You can use you're own Redis server by only running `npm test` after modifying the configuration file located in "conf/test.coffee".

If Redis is installed, start a redis server on the default port:
`redis-server ./conf/redis.conf`

If Docker is installed, start a container:
`docker run --name ron -p 6379:6379 -d redis redis-server --appendonly yes`
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -31,6 +31,8 @@
"engines": { "node": ">= 0.4.0" },
"scripts": {
"coffee": "coffee -b -o lib src",
"redis_start": "docker run --name ron -p 6379:6379 -d redis",
"redis_stop": "docker rm -f ron",
"pretest": "cp -n conf/test.coffee.sample conf/test.coffee; coffee -b -o lib src",
"test": "mocha"
}
Expand Down

0 comments on commit 6af6b50

Please sign in to comment.