Skip to content

Commit

Permalink
fix(reporter-tap): fix issue with test count starting from 0 instead …
Browse files Browse the repository at this point in the history
…of 1
  • Loading branch information
andreidmt committed Feb 8, 2023
1 parent 7eff83f commit db685c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/reporters/_signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { TestResult } from "../runTest.js"

type IntroFormatter = (props: { count: number }) => string

type TestFormatter = (props: { index?: number; result: TestResult }) => string
type TestFormatter = (props: { index: number; result: TestResult }) => string

type SuiteFormatter = (props: {
passCount: number
Expand Down
2 changes: 1 addition & 1 deletion lib/reporters/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const formatTest = ({ index, result: { name, duration, errors } }) => {
const humanReadableDuration = formatHrTime(duration)

if (errors.length === 0) {
return `ok ${index} - ${name} ${humanReadableDuration}`
return `ok ${index + 1} - ${name} ${humanReadableDuration}`
}

const output = [`not ok - ${index} ${name} ${humanReadableDuration}`]
Expand Down

0 comments on commit db685c5

Please sign in to comment.