forked from redis/node-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redis#776 from NodeRedis/test-tweaks
various fixes to tests, along with groundwork for adding travis and coveralls support
- Loading branch information
Showing
10 changed files
with
103 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
examples/ | ||
benches/ | ||
test.js | ||
test/ | ||
diff_multi_bench_output.js | ||
generate_commands.js | ||
multi_bench.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: node_js | ||
sudo: true | ||
node_js: | ||
- "0.10" | ||
- "0.12" | ||
- "iojs" | ||
before_install: | ||
- 'printf ''bind ::1 127.0.0.1\nunixsocket /tmp/redis.sock\ndaemonize yes\nunixsocketperm 777'' >> /tmp/redis.conf' | ||
before_script: | ||
- sudo redis-server /tmp/redis.conf | ||
after_success: npm run coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,22 @@ | |
"version": "0.12.1", | ||
"description": "Redis client library", | ||
"keywords": [ | ||
"redis", | ||
"database" | ||
"database", | ||
"redis" | ||
], | ||
"author": "Matt Ranney <[email protected]>", | ||
"license": "MIT", | ||
"main": "./index.js", | ||
"scripts": { | ||
"test": "node ./test.js", | ||
"coverage": "nyc npm test && nyc report" | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"test": "nyc ./test/run.sh" | ||
}, | ||
"devDependencies": { | ||
"colors": "~0.6.0-1", | ||
"coveralls": "^2.11.2", | ||
"hiredis": "^0.4.0", | ||
"metrics": ">=0.1.5", | ||
"nyc": "^2.2.0", | ||
"nyc": "^3.0.0", | ||
"underscore": "~1.4.4" | ||
}, | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var assert = require("assert"); | ||
var Queue = require('../lib/queue'); | ||
|
||
module.exports = function (tests, next) { | ||
var q = new Queue(); | ||
|
||
tests.push = function () { | ||
q.push('a'); | ||
q.push(3); | ||
assert.equal(q.length, 2); | ||
return next(); | ||
} | ||
|
||
tests.shift = function () { | ||
assert.equal(q.shift(), 'a'); | ||
return next(); | ||
} | ||
|
||
tests.forEach = function () { | ||
q.forEach(function (v) { | ||
assert.equal(v, 3); | ||
}); | ||
|
||
return next(); | ||
} | ||
|
||
tests.forEachWithScope = function () { | ||
q.forEach(function (v) { | ||
assert.equal(this.foo, 'bar'); | ||
assert.equal(v, 3); | ||
}, {foo: 'bar'}); | ||
|
||
return next(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
node ./test/test.js false hiredis | ||
node ./test/test.js false javascript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters