Skip to content

Commit

Permalink
fix: fixed cypress 12 compatibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelangarano committed Sep 26, 2023
1 parent b404c45 commit d96de4f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@


# [2.0.0-beta.1](https://github.com/currents-dev/cypress-cloud/compare/v2.0.0-beta.0...v2.0.0-beta.1) (2023-09-22)


### Bug Fixes

* debugging fixes ([d502b12](https://github.com/currents-dev/cypress-cloud/commit/d502b121b4a5bb85921fa26b6b04a12274be3b19))
- debugging fixes ([d502b12](https://github.com/currents-dev/cypress-cloud/commit/d502b121b4a5bb85921fa26b6b04a12274be3b19))

# [2.0.0-beta.0](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.1...v2.0.0-beta.0) (2023-09-19)

Expand Down Expand Up @@ -339,4 +336,4 @@
- implement generic http client with retries ([a9711bd](https://github.com/currents-dev/cypress-cloud/commit/a9711bde1fbb2cd37dbc8979593159d183bfa866))
- improve setup steps ([9bf16fe](https://github.com/currents-dev/cypress-cloud/commit/9bf16fe5f3773db4aa2f169515303ea6d0973da6))
- separate stdout per spec file ([a9d01c3](https://github.com/currents-dev/cypress-cloud/commit/a9d01c349cbfe140a568a452b0e7163e6d27f2db))
- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6))
- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6))
2 changes: 1 addition & 1 deletion packages/cypress-cloud/lib/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const getGitInfo = async (projectRoot: string) => {
const commitInfo = await git.commitInfo(projectRoot);
return getCommitDefaults({
branch: commitInfo.branch,
remoteOrigin: commitInfo.remote ?? 'null',
remoteOrigin: commitInfo.remote ?? "null",
authorEmail: commitInfo.email,
authorName: commitInfo.author,
message: commitInfo.message,
Expand Down
19 changes: 12 additions & 7 deletions packages/cypress-cloud/lib/results/specAfterResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ export class SpecAfterResult {
timings: "timings" in cypressAttempt ? cypressAttempt.timings : null,
wallClockStartedAt:
"wallClockStartedAt" in cypressAttempt
? (cypressAttempt.wallClockStartedAt ?? new Date().toISOString())
? cypressAttempt.wallClockStartedAt ?? new Date().toISOString()
: new Date().toISOString(),
startedAt:
"startedAt" in cypressAttempt
? (cypressAttempt.startedAt ?? new Date().toISOString())
? cypressAttempt.startedAt ?? new Date().toISOString()
: new Date().toISOString(),
wallClockDuration: duration ? duration : 0,
failedFromHookId:
Expand All @@ -127,7 +127,7 @@ export class SpecAfterResult {
: null,
videoTimestamp:
"videoTimestamp" in cypressAttempt
? (cypressAttempt.videoTimestamp ?? 0)
? cypressAttempt.videoTimestamp ?? 0
: 0,
};
}
Expand All @@ -154,9 +154,9 @@ export class SpecAfterResult {
"videoTimestamp" in cypressAttempt
? cypressAttempt.videoTimestamp
: SpecAfterResult.getAttemptVideoTimestamp(
parseISO(mochaAttempt.wallClockStartedAt).getTime(),
specStartedAt.getTime()
),
parseISO(mochaAttempt.wallClockStartedAt).getTime(),
specStartedAt.getTime()
),
};
}

Expand Down Expand Up @@ -201,7 +201,12 @@ export class SpecAfterResult {
spec: CypressTypes.EventPayload.SpecAfter.Spec
): Standard.SpecAfter.Spec {
return {
name: parseFloat(_cypressVersion!) >= 13 ? spec.name : ("baseName" in spec ? spec.baseName : ""),
name:
parseFloat(_cypressVersion!) >= 13
? spec.name
: "baseName" in spec
? spec.baseName
: "",
relative: spec.relative,
absolute: spec.absolute,
fileExtension: spec.fileExtension,
Expand Down

0 comments on commit d96de4f

Please sign in to comment.