Skip to content
This repository was archived by the owner on Feb 19, 2020. It is now read-only.

Commit be6eb0a

Browse files
committed
Merge pull request #8 from codacy/update-deps
Update dependencies and add building for Node 0.12
2 parents fdb0517 + 059eed6 commit be6eb0a

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sudo: false
33
node_js:
44
- '0.10'
55
- '0.11'
6+
- '0.12'
67
matrix:
78
fast_finish: true
89
script: npm test

lib/reporter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
commitIdValidation = Joi.string().required().min(1).example('1234567890'), //TODO: Revisit this validation to see if we can better validate the values
99
coverageDataValidation = Joi.object({
1010
total: Joi.number().integer().required().min(0).max(100),
11-
fileReports: Joi.array().required().includes(Joi.object({
11+
fileReports: Joi.array().required().items(Joi.object({
1212
filename: Joi.string().required().min(1),
1313
total: Joi.number().integer().required().min(0).max(100),
1414
coverage: Joi.object().pattern(/\d/, Joi.number().integer().min(1))
15-
}).optional())
15+
}).required())
1616
}).example({total: 50, fileReports: [{filename: 'filename', total: 10, coverage: {1: 1, 2: 3}}]});
1717

1818
module.exports = function (options) {

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@
3333
"codacy-coverage": "./bin/codacy-coverage.js"
3434
},
3535
"dependencies": {
36-
"bluebird": "^2.9.25",
36+
"bluebird": "^2.9.x",
3737
"commander": "^2.x",
38-
"joi": "^5.x",
38+
"joi": "^6.4.x",
3939
"lcov-parse": "0.x",
4040
"log-driver": "^1.x",
4141
"request-promise": "^0.x"
4242
},
4343
"devDependencies": {
4444
"buddy.js": "^0.x",
45-
"chai": "<1.10",
46-
"chai-as-promised": "^4.x",
45+
"chai": "^2.3.x",
46+
"chai-as-promised": "^5.0.x",
4747
"dirty-chai": "^1.x",
4848
"nsp": "^1.x",
4949
"mocha": "^2.x",
50-
"nock": "^0.x",
50+
"nock": "^2.0.x",
5151
"istanbul": "^0.x",
5252
"jscs": "^1.x",
5353
"jshint": "^2.x",

test/coverageParser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}).to.not.throw();
1919
});
2020
it('shouldn\'t be able to parse a blank coverage file for ' + format, function () {
21-
return expect(parser.getParser(format).parse('')).to.eventually.be.rejectedWith(Error, 'value is required');
21+
return expect(parser.getParser(format).parse('')).to.eventually.be.rejectedWith(Error, '"value" is required');
2222
});
2323
it('shouldn\'t be able to parse invalid coverage for ' + format, function () {
2424
return expect(parser.getParser(format).parse('', 'There is no Dana, only Zuul')).to.eventually.be.rejectedWith(Error, 'Failed to parse string');

test/reporter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
beforeEach(function () {
1111
bodyValidator = Joi.object({
1212
total: Joi.number().valid(50),
13-
fileReports: Joi.array().includes(Joi.object({
13+
fileReports: Joi.array().items(Joi.object({
1414
filename: Joi.string().valid('filename'),
1515
total: Joi.number().valid(10),
1616
coverage: Joi.object({
@@ -54,12 +54,12 @@
5454

5555
return expect(reporter({})
5656
.sendCoverage('1234', '4321', sampleCoverageData))
57-
.to.eventually.be.rejectedWith(Error, 'fileReports at position 0 fails because 3 must be larger than or equal to 1');
57+
.to.eventually.be.rejectedWith(Error, 'child "fileReports" fails because ["fileReports" does not contain 1 required value(s)]');
5858
});
5959
it('shouldn\'t be able to create a reporter with invalid options', function () {
6060
expect(function () {
6161
reporter({endpoint: 1});
62-
}).to.throw(Error, 'endpoint must be a string');
62+
}).to.throw(Error, 'child "endpoint" fails because ["endpoint" must be a string]');
6363
});
6464
it('should be able to use the reporter to send coverage data', function () {
6565
return helper.setupMockEndpoint('1234', '4321', bodyValidator)

0 commit comments

Comments
 (0)