-
Notifications
You must be signed in to change notification settings - Fork 14
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 #26 from makeomatic/feat/codecov
Feat/codecov
- Loading branch information
Showing
14 changed files
with
67 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
instrumentation: | ||
root: src | ||
|
||
reporting: | ||
reports: | ||
- lcovonly |
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ | ||
"name": "ms-users", | ||
"version": "0.9.3", | ||
"description": "Core of the microservice for handling users", | ||
"main": "./lib/index.js", | ||
"scripts": { | ||
"compile": "./node_modules/.bin/babel -d ./lib ./src", | ||
"rebuild": "if [ \"$SKIP_REBUILD\" != \"1\" ]; then npm rebuild; fi", | ||
"prepublish": "npm run compile", | ||
"test": "./test/docker.sh", | ||
"start": "node ./bin/mservice.js | ./node_modules/.bin/bunyan -o short" | ||
"start": "node ./bin/mservice.js | ./node_modules/.bin/bunyan -o short", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/makeomatic/ms-users.git" | ||
"url": "https://github.com/makeomatic/ms-users.git" | ||
}, | ||
"author": "Vitaly Aminev <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -54,17 +54,24 @@ | |
"babel-preset-stage-0": "^6.3.13", | ||
"babel-register": "^6.3.13", | ||
"chai": "^3.4.1", | ||
"codecov.io": "^0.1.6", | ||
"cz-conventional-changelog": "^1.1.5", | ||
"eslint": "^1.10.3", | ||
"eslint-config-airbnb": "^2.1.1", | ||
"eslint-plugin-mocha": "^1.1.0", | ||
"faker": "^3.0.1", | ||
"isparta": "^4.0.0", | ||
"istanbul": "^0.4.0", | ||
"json": "^9.0.3", | ||
"mocha": "^2.3.3", | ||
"mocha-multi": "^0.7.2", | ||
"semantic-release": "^4.3.5", | ||
"server-destroy": "^1.0.1", | ||
"sinon": "^1.17.2" | ||
}, | ||
"release": { | ||
"verifyConditions": [] | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
|
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,17 @@ | ||
const fs = require('fs'); | ||
const glob = require('glob'); | ||
const istanbul = require('istanbul'); | ||
const reporter = new istanbul.Reporter(); | ||
const collector = new istanbul.Collector(); | ||
|
||
reporter.addAll(['lcov', 'html', 'text-summary']); | ||
|
||
glob.sync('./coverage/**/coverage*.json').forEach(file => { | ||
process.stdout.write('adding file: ' + file + '\n'); | ||
collector.add(JSON.parse(fs.readFileSync(file))); | ||
}); | ||
|
||
reporter.write(collector, true, () => { | ||
process.stdout.write('report combined...\n'); | ||
process.exit(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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
/* global inspectPromise */ | ||
const { expect } = require('chai'); | ||
const redisKey = require('../../lib/utils/key.js'); | ||
const redisKey = require('../../src/utils/key.js'); | ||
const URLSafeBase64 = require('urlsafe-base64'); | ||
|
||
describe('#activate', function activateSuite() { | ||
const headers = { routingKey: 'users.activate' }; | ||
const emailValidation = require('../../lib/utils/send-email.js'); | ||
const emailValidation = require('../../src/utils/send-email.js'); | ||
const email = '[email protected]'; | ||
|
||
beforeEach(global.startService); | ||
|
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/* global inspectPromise */ | ||
const { expect } = require('chai'); | ||
const redisKey = require('../../lib/utils/key.js'); | ||
const redisKey = require('../../src/utils/key.js'); | ||
const ld = require('lodash'); | ||
|
||
describe('#login', function loginSuite() { | ||
const headers = { routingKey: 'users.login' }; | ||
const user = { username: '[email protected]', password: 'nicepassword', audience: '*.localhost' }; | ||
const userWithValidPassword = { username: '[email protected]', password: 'nicepassword1', audience: '*.localhost' }; | ||
const scrypt = require('../../lib/utils/scrypt.js'); | ||
const scrypt = require('../../src/utils/scrypt.js'); | ||
|
||
before(function test() { | ||
return scrypt.hash(userWithValidPassword.password).then(pass => { | ||
|
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/* global inspectPromise */ | ||
const { expect } = require('chai'); | ||
const redisKey = require('../../lib/utils/key.js'); | ||
const redisKey = require('../../src/utils/key.js'); | ||
|
||
describe('#updatePassword', function updatePasswordSuite() { | ||
const headers = { routingKey: 'users.updatePassword' }; | ||
const username = '[email protected]'; | ||
const password = '123'; | ||
const audience = '*.localhost'; | ||
const emailValidation = require('../../lib/utils/send-email.js'); | ||
const emailValidation = require('../../src/utils/send-email.js'); | ||
|
||
beforeEach(global.startService); | ||
afterEach(global.clearRedis); | ||
|
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ describe('#verify', function verifySuite() { | |
}); | ||
|
||
describe('valid token', function suite() { | ||
const jwt = require('../../lib/utils/jwt.js'); | ||
const jwt = require('../../src/utils/jwt.js'); | ||
|
||
beforeEach(function pretest() { | ||
return this.users.router({ username: '[email protected]', password: '123', audience: 'test' }, { routingKey: 'users.register' }); | ||
|