-
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.
- Loading branch information
Hans Kristian Flaatten
committed
Jul 3, 2016
1 parent
3275a92
commit fda4717
Showing
5 changed files
with
152 additions
and
0 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
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,61 @@ | ||
'use strict'; | ||
|
||
const ObjectID = require('mongodb').ObjectID; | ||
|
||
module.exports = [ | ||
{ | ||
_id: new ObjectID('100000000000000000000000'), | ||
provider: 'FOO', | ||
apps: [ | ||
{ | ||
_id: new ObjectID('100000000000000000000001'), | ||
name: 'foo_app1', | ||
limit: { | ||
test: 499, | ||
dev: 500, | ||
prod: 5000, | ||
}, | ||
key: { | ||
test: 'foo_app1_test', | ||
dev: 'foo_app1_dev', | ||
prod: 'foo_app1_prod', | ||
}, | ||
active: true, | ||
}, | ||
], | ||
}, { | ||
_id: new ObjectID('200000000000000000000000'), | ||
provider: 'FOO', | ||
apps: [ | ||
{ | ||
_id: new ObjectID('200000000000000000000001'), | ||
name: 'bar_app1', | ||
limit: { | ||
test: 499, | ||
dev: 500, | ||
prod: 5000, | ||
}, | ||
key: { | ||
test: 'bar_app1_test', | ||
dev: 'bar_app1_dev', | ||
prod: 'bar_app1_prod', | ||
}, | ||
active: true, | ||
}, { | ||
_id: new ObjectID('200000000000000000000002'), | ||
name: 'bar_app2', | ||
limit: { | ||
test: 499, | ||
dev: 500, | ||
prod: 5000, | ||
}, | ||
key: { | ||
test: 'bar_app2_test', | ||
dev: 'bar_app2_dev', | ||
prod: 'bar_app2_prod', | ||
}, | ||
active: true, | ||
}, | ||
], | ||
}, | ||
]; |
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,7 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
api: { | ||
users: require('./data/api.users'), | ||
}, | ||
}; |
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,53 @@ | ||
{ | ||
"name": "@turbasen/test-data", | ||
"version": null, | ||
"description": "Test data for internal Nasjonal Turbase API development", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"codacy-coverage": "codacy-coverage", | ||
"cover": "istanbul cover --report lcovonly ./node_modules/.bin/_mocha -- -R spec test.js", | ||
"grunt:watch": "grunt watch", | ||
"lint": "eslint index.js test.js", | ||
"nsp": "nsp check", | ||
"semantic-release": "semantic-release", | ||
"test": "mocha -R tap -b --check-leaks test.js", | ||
"test:watch": "mocha -R progress -b --check-leaks -w test.js", | ||
"greenkeeper-postpublish": "greenkeeper-postpublish" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Turbasen/test-data.git" | ||
}, | ||
"keywords": [ | ||
"nasjonal turbase", | ||
"turbasen", | ||
"test", | ||
"data" | ||
], | ||
"author": "Hans Kristian Flaatten <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/Turbasen/test-data/issues" | ||
}, | ||
"homepage": "https://github.com/Turbasen/test-data#readme", | ||
"dependencies": { | ||
"mongodb": "^2.1.18" | ||
}, | ||
"devDependencies": { | ||
"codacy-coverage": "^1.1.3", | ||
"eslint": "^2.13.1", | ||
"eslint-config-airbnb-base": "^3.0.1", | ||
"eslint-plugin-import": "^1.10.0", | ||
"greenkeeper-postpublish": "^1.0.0", | ||
"istanbul": "^0.4.4", | ||
"mocha": "^2.5.3", | ||
"nsp": "^2.5.0", | ||
"semantic-release": "^4.3.5" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
} | ||
} |
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,23 @@ | ||
'use strict'; | ||
|
||
const data = require('.'); | ||
const assert = require('assert'); | ||
const ObjectID = require('mongodb').ObjectID; | ||
|
||
describe('data', () => { | ||
it('exports test data', () => { | ||
assert.deepEqual(Object.keys(data), ['api']); | ||
assert.deepEqual(Object.keys(data.api), ['users']); | ||
}); | ||
}); | ||
|
||
describe('api.users', () => { | ||
it('exports api users', () => { | ||
assert(data.api.users instanceof Array); | ||
assert.equal(data.api.users.length, 2); | ||
|
||
data.api.users.forEach(user => { | ||
assert(user._id instanceof ObjectID); | ||
}); | ||
}); | ||
}); |