Skip to content

Commit

Permalink
adds basic test & .travis.yml #2
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Feb 16, 2015
1 parent ed38fa3 commit 97db042
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- 0.12
- iojs
services:
- redis-server
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ if you want to be sure that your data is saved,

+ Redis **persistence** ***demystified***: http://oldblog.antirez.com/post/redis-persistence-demystified.html

### Redis in Practice

+ Travis-CI gives you access to Redis: http://docs.travis-ci.com/user/database-setup/#Redis


## Graphical User Interface (GUI) for Viewing/Setting Data

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"scripts": {
"view-cov": "open .",
"codeclimate": "CODECLIMATE_REPO_TOKEN=0839d00dd01047ffadfb3c56bf9c9baa0047179de582a47517e3f558ad4eafff ./node_modules/codeclimate-test-reporter/bin/codeclimate.js < ./coverage/lcov.info",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape ./api/test/*.js | node_modules/tap-spec/bin/cmd.js && ./node_modules/.bin/istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
"test": "istanbul cover ./node_modules/tape/bin/tape ./api/test/*.js | node_modules/tap-spec/bin/cmd.js",
"spec": "node ./node_modules/tape/bin/tape ./api/test/*.js | node_modules/tap-spec/bin/cmd.js"
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape ./test/*.js | node_modules/tap-spec/bin/cmd.js && ./node_modules/.bin/istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
"test": "istanbul cover ./node_modules/tape/bin/tape ./test/*.js | node_modules/tap-spec/bin/cmd.js",
"spec": "node ./node_modules/tape/bin/tape ./test/*.js | node_modules/tap-spec/bin/cmd.js"
}
}
14 changes: 14 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var test = require('tape');
var redis = require("redis");
var client = redis.createClient();

test("The value for key 'Hello' should be 'World' ", function(t) {
client.set("Hello", "World", redis.print);
client.get("Hello", function(err, reply) {
// reply is null when the key is missing
console.log('Hello ' + reply);
t.equal(reply, 'World', 'value for key Hello is World (as expected).');
client.end();
t.end();
});
});

0 comments on commit 97db042

Please sign in to comment.