cypress
cypress copied to clipboard
after:spec result does not match specification
Current behavior
My plugin listens to the after:spec
event and reports on the results it receives. The stats
property of results
has the following properties:
{
suites: 1,
tests: 1,
passes: 1,
pending: 0,
skipped: 0,
failures: 0,
wallClockStartedAt: '2022-09-13T15:47:03.696Z',
wallClockEndedAt: '2022-09-13T15:47:05.123Z',
wallClockDuration: 1427
}
Desired behavior
According to https://github.com/cypress-io/cypress/blob/566a1a208cb51d193fd1838a4c35ab872a729fe7/cli/types/cypress.d.ts#L5565, the results
type is CypressCommandLine.RunResult
.
The RunResult
interface describes stats
as:
stats: {
suites: number
tests: number
passes: number
pending: number
skipped: number
failures: number
startedAt: dateTimeISO
endedAt: dateTimeISO
duration: ms
}
This does not match the actual object's properties that I'm receiving.
In particular:
- startedAt vs wallClockStartedAt
- endedAt vs wallClockEndedAt
- duration vs wallClockDuration
Test code to reproduce
Simply listen to the after:spec
event and inspect the results.
Cypress Version
10.7.0
Node version
v16.13.0
Operating System
macOS 12.4
Debug Logs
No response
Other
No response
@alexplischke thanks for submitting this issue. I can confirm that these properties are not returning as expected:

Expected from cypress-npm-api.d.ts
:
Hi, I would like contribute new issues. @admah @nagash77 this is a good issue to contribute?
Hi, I see that another person is assigned to this issue, but their pull request doesn't pass the tests. Can I make another pull request too?
The code for this is done, but this has yet to be released. We'll update this issue and reference the changelog when it's released.
Released in Cypress 13.0.0.