fix: broken test results

This commit is contained in:
liyasthomas
2021-08-27 12:38:03 +05:30
parent e9043e6762
commit a3551c6719
5 changed files with 72 additions and 26 deletions

View File

@@ -45,6 +45,7 @@ export function runRESTRequest$(): Observable<HoppRESTResponse> {
}
| {
result: "PASS"
message: string
styles: { icon: "check"; class: "success-response" }
}
| { startBlock: string; styles: { icon: ""; class: "" } }
@@ -98,7 +99,11 @@ function translateToNewTestResults(testReport: {
message: string
styles: { icon: "close"; class: "cl-error-response" }
}
| { result: "PASS"; styles: { icon: "check"; class: "success-response" } }
| {
result: "PASS"
message: string
styles: { icon: "check"; class: "success-response" }
}
| { startBlock: string; styles: { icon: ""; class: "" } }
| { endBlock: true; styles: { icon: ""; class: "" } }
>
@@ -129,6 +134,7 @@ function translateToNewTestResults(testReport: {
// A normal PASS expectation
testsStack[testsStack.length - 1].expectResults.push({
status: "pass",
message: result.message,
})
} else if (isTestFail(result)) {
// A normal FAIL expectation

View File

@@ -1,6 +1,7 @@
export type HoppTestExpectResult =
| { status: "pass" }
| { status: "fail" | "error"; message: string }
export type HoppTestExpectResult = {
status: "fail" | "pass" | "error"
message: string
}
export type HoppTestData = {
description: string