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

Commit

Permalink
Add jacoco as valid format, change error message for tests based on r…
Browse files Browse the repository at this point in the history
…eport format
  • Loading branch information
Chaitanya-Chatla committed Nov 20, 2018
1 parent cf38534 commit 78f4164
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/coverageParser.js
Expand Up @@ -2,8 +2,11 @@
'use strict';

var expect = helper.chai.expect;
var validFormats = ['lcov'];

var validFormats = ['lcov','jacoco'];
var errorMsg = new Map([
{lcov: 'Failed to parse string'},
{jacoco: 'Request handle not found.'}
]);
describe('Coverage Parser', function () {
it('should receive an error when trying to use an unsupported format', function () {
expect(function () {
Expand All @@ -21,11 +24,11 @@
return expect(parser.getParser(format).parse('')).to.eventually.be.rejectedWith(Error, '"value" is required');
});
it('shouldn\'t be able to parse invalid coverage for ' + format, function () {
return expect(parser.getParser(format).parse('', 'There is no Dana, only Zuul')).to.eventually.be.rejectedWith(Error, 'Failed to parse string');
return expect(parser.getParser(format).parse('', 'There is no Dana, only Zuul')).to.eventually.be.rejectedWith(Error, errorMsg.get(format));
});
it('shouldn\'t be able to parse a non-existent coverage file for ' + format, function () {
return expect(parser.getParser(format).parse('', '/no-exist/lcov')).to.eventually.be.rejectedWith(Error, 'Failed to parse string');
return expect(parser.getParser(format).parse('', '/no-exist/lcov')).to.eventually.be.rejectedWith(Error, errorMsg.get(format));
});
});
});
}(require('util'), require('../lib/coverageParser'), require('./helper')));
}(require('util'), require('../lib/coverageParser'), require('./helper')));

0 comments on commit 78f4164

Please sign in to comment.