Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Instantiate new redis-server process for testing environment and shut…

… it down after test completion.
  • Loading branch information...
commit 0dc968fd246cd05181f3d15ae64548e78ef4cec3 1 parent 9a12ba0
@iloire authored
Showing with 6 additions and 3 deletions.
  1. +1 −1  package.json
  2. +3 −0  test/redis.conf
  3. +2 −2 test/storage_redis.mocha
View
2  package.json
@@ -2,7 +2,7 @@
"author": "Iván Loire <ivan@iloire.com> (http://iloire.com/)",
"name": "watchmen",
"scripts": {
- "test": "mocha -R list -b test/*.mocha"
+ "test": "redis-server test/redis.conf;mocha -R list -b test/*.mocha;kill `cat test/redis.pid`"
},
"description": "A Node.js HTTP monitor",
"version": "0.9.0",
View
3  test/redis.conf
@@ -0,0 +1,3 @@
+port 6666
+daemonize yes
+pidfile test/redis.pid
View
4 test/storage_redis.mocha
@@ -5,8 +5,8 @@ var mocked_ping_service = require ('./lib/mock/request_mocked');
describe('redis storage', function(){
- var redis_options = require('../config/storage').options.redis;
- var redis_storage = new redis_storage_class(redis_options);
+ //use redis_storage with testing environment
+ var redis_storage = new redis_storage_class({port: 6666, host: '127.0.0.1', db: 0});
var _watchmen = new watchmen(null, redis_storage);
var services = require ('../lib/services').load_services();
Please sign in to comment.
Something went wrong with that request. Please try again.