Skip to content

Commit 68db8a0

Browse files
committed
Adding Travis Files & Tests
1 parent 1117628 commit 68db8a0

10 files changed

+116
-6
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain
2+
# consistent coding styles between different editors and IDEs.
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/

.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"airbnb"
5+
],
6+
"env": {
7+
"browser": true,
8+
"node": true
9+
}
10+
}

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language: node_js
2+
sudo: false
3+
services:
4+
- redis-server
5+
node_js:
6+
- "9"
7+
- "8"
8+
- "7"
9+
- "6"
10+
- "5"
11+
- "4"
12+
- "iojs"
13+
- "0.12"
14+
- "0.10"
15+
- "0.8"
16+
before_install:
17+
- 'nvm install-latest-npm'
18+
install:
19+
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
20+
matrix:
21+
fast_finish: true
22+
allow_failures:
23+
- node_js: "9"
24+
- node_js: "7"
25+
- node_js: "5"
26+
- node_js: "iojs"

LICENSE

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This software is released under the MIT license:
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This is a light weight wrapper over the node_redis library with first class prom
55

66
## Usage Example
77

8+
### Creating Connection
89
```js
910
const asyncRedis = require("async-redis");
1011
const client = asyncRedis.createClient();
@@ -18,7 +19,7 @@ const asyncBlock = async () => {
1819
};
1920
```
2021

21-
## Decorating Existing Connection
22+
### Decorating Existing Connections
2223
```js
2324
const redis = require("redis");
2425
const client = redis.createClient();

package.json

+26-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
{
2+
"private": false,
23
"name": "async-redis",
34
"version": "1.0.0",
45
"description": "A light wrapper over redis_node for first class promise support.",
56
"main": "index.js",
7+
"engines": {
8+
"node": ">=0.10.0"
9+
},
610
"scripts": {
7-
"test": "mocha test --recursive"
11+
"lint": "eslint --ext .js, src test",
12+
"test": "mocha test --recursive",
13+
"version:patch": "npm --no-git-tag-version version patch",
14+
"version:minor": "npm --no-git-tag-version version minor",
15+
"version:major": "npm --no-git-tag-version version major"
816
},
917
"keywords": [
1018
"redis",
@@ -15,11 +23,27 @@
1523
"author": "Matthew Oaxaca",
1624
"license": "MIT",
1725
"dependencies": {
18-
"redis": "^2.7.1",
26+
"redis": "^2.8.0",
1927
"redis-commands": "^1.3.1"
2028
},
2129
"devDependencies": {
2230
"chai": "^3.5.0",
31+
"eslint": "^4.17.0",
32+
"eslint-config-airbnb": "^16.1.0",
33+
"eslint-plugin-import": "^2.8.0",
34+
"eslint-plugin-jsx-a11y": "^6.0.3",
35+
"eslint-plugin-react": "^7.6.1",
2336
"mocha": "^3.2.0"
37+
},
38+
"repository": {
39+
"type": "git",
40+
"url": "git://github.com/moaxaca/async-redis.git"
41+
},
42+
"bugs": {
43+
"url": "https://github.com/moaxaca/async-redis/issues"
44+
},
45+
"directories": {
46+
"example": "examples",
47+
"test": "test"
2448
}
2549
}

test/integration/decorate-redis.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const { assert } = require('chai');
2+
const redis = require('redis');
3+
const commands = require('redis-commands').list;
4+
5+
const AsyncRedis = require('../../index');
6+
7+
describe('AsyncRedis.decorate', function () {
8+
const client = redis.createClient();
9+
const asyncRedisClient = AsyncRedis.decorate(client);
10+
11+
it('should have decorated every command', async () => {
12+
for (let command of commands) {
13+
assert.isFunction(asyncRedisClient[command], `Command isn't decorated ${command}`);
14+
}
15+
});
16+
});

test/integration/redis.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
"use strict";
2-
31
const { assert } = require('chai');
42
const AsyncRedis = require('../../index');
53

6-
describe('AsyncDecorator', function () {
4+
describe('AsyncRedis.createClient', function () {
75
let redisClient = AsyncRedis.createClient();
86

97
afterEach(async() => {

0 commit comments

Comments
 (0)