Skip to content

Minor correctness cleanups in reporters and helpers #8

@dalberola

Description

@dalberola

Low-severity correctness items (agent-reported; [needs repro]).

  • configureReporters default case missing return. packages/dredd/lib/configureReporters.js: the default branch constructs a BaseReporter then discards it.
  • BaseReporter invalid date. packages/dredd/lib/reporters/BaseReporter.js: new Date(test.start) without a presence guard yields Invalid Date / NaN durations when test.start is missing.
  • isURL not case-insensitive. packages/dredd/lib/isURL.ts: /^http(s)?:\/\// rejects HTTP://...; use the i flag.
  • reporterCount has no negative guard in the emitStart/emit accounting (TransactionRunner.js); === 0 can be missed if a callback fires more than once.
  • Dead duplicate else-if in packages/dredd/lib/reporters/ApiaryReporter.js:71 (both branches assign the same value; flagged by an inline eslint-disable). Already noted locally; fix the logic or drop the branch.

Tasks

  • Add the missing return in configureReporters.
  • Guard test.start before new Date(...).
  • Add i flag to the isURL regex.
  • Make reporter-count completion fire exactly once.
  • Resolve the ApiaryReporter._get duplicate branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions