Skip to content

Commit

Permalink
Fix test for empty reporter option
Browse files Browse the repository at this point in the history
  • Loading branch information
MisanthropicBit committed Feb 6, 2024
1 parent 3be4ff7 commit 4a3162a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/mocha-multi-reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function parseReporterOptions(options: mocha.RunnerOptions): Record<string, Reco

if (option.trim().length === 0) {
console.error('Empty option for reporter')
continue
}

const [reporterName, configKey] = option.split(':')
Expand Down
4 changes: 2 additions & 2 deletions tests/mocha-multi-reporter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('mocha-multi-reporter', () => {
expect(stderr, 'to equal', '')
})

it.skip('reports empty option for reporter', async () => {
it('reports empty option for reporter', async () => {
const command = [
'mocha',
'--reporter',
Expand All @@ -60,7 +60,7 @@ describe('mocha-multi-reporter', () => {

expect(stdout, 'to contain', '"fullTitle"')
expect(stdout, 'to contain', '1 passing')
expect(stderr, 'to equal', 'Empty option for reporter')
expect(stderr, 'to equal', 'Empty option for reporter\n')
})

it('reports unparsed reporter option', async () => {
Expand Down

0 comments on commit 4a3162a

Please sign in to comment.