diff --git a/tests/lib/MultiReporters.test.js b/tests/lib/MultiReporters.test.js index 0600d3b..072d3dd 100644 --- a/tests/lib/MultiReporters.test.js +++ b/tests/lib/MultiReporters.test.js @@ -110,6 +110,13 @@ describe('lib/MultiReporters', function () { }); describe('#external', function () { + var checkReporterOptions = function (options) { + expect(reporter.getReporterOptions(reporter.getOptions(options), 'mocha-junit-reporter')).to.be.deep.equal({ + id: 'mocha-junit-reporter', + mochaFile: 'junit.xml' + }); + }; + describe('json', function() { beforeEach(function () { var mocha = new Mocha({ @@ -126,12 +133,9 @@ describe('lib/MultiReporters', function () { reporter = new mocha._reporter(runner, options); }); - describe('#options (external reporters - single)', function () { - it('return reporter options: "dot"', function () { - expect(reporter.getReporterOptions(reporter.getOptions(options), 'mocha-junit-reporter')).to.be.deep.equal({ - id: 'mocha-junit-reporter', - mochaFile: 'junit.xml' - }); + describe('#options (external reporters w/ json - single)', function () { + it('json: return reporter options: "dot"', function () { + checkReporterOptions(options); }); }); }); @@ -152,12 +156,9 @@ describe('lib/MultiReporters', function () { reporter = new mocha._reporter(runner, options); }); - describe('#options (external reporters - single)', function () { - it('return reporter options: "dot"', function () { - expect(reporter.getReporterOptions(reporter.getOptions(options), 'mocha-junit-reporter')).to.be.deep.equal({ - id: 'mocha-junit-reporter', - mochaFile: 'junit.xml' - }); + describe('#options (external reporters w/ commonjs - single)', function () { + it('commonjs: return reporter options: "dot"', function () { + checkReporterOptions(options); }); }); });