Skip to content

Commit

Permalink
fix(mocha): don't insert empty argument if default config is used
Browse files Browse the repository at this point in the history
mocha was interpreting this extra empty arg as a file glob of "", and
always logging a warning that the file glob didn't match any files to
test. This fixes the noise.
  • Loading branch information
ivomurrell committed Apr 28, 2023
1 parent 180f510 commit 2e5e6dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/mocha/src/tasks/mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export default class Mocha extends Task<typeof MochaSchema> {
async run(): Promise<void> {
const files = await promisify(glob)(this.options.files)

const args = ['--color', this.options.configPath ? `--config=${this.options.configPath}` : '', ...files]
const args = ['--color', ...files]
if (this.options.configPath) {
args.unshift(`--config=${this.options.configPath}`)
}
this.logger.info(`running mocha ${args.join(' ')}`)
const child = fork(mochaCLIPath, args, { silent: true })
hookFork(this.logger, 'mocha', child)
Expand Down

0 comments on commit 2e5e6dc

Please sign in to comment.