feat: handle test script execution failure (#2104)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Rishabh Agarwal
2022-02-01 14:29:18 +05:30
committed by GitHub
parent aaecba043b
commit 9c21013a06
4 changed files with 33 additions and 3 deletions

View File

@@ -71,9 +71,15 @@ export const runRESTRequest$ = (): TaskEither<
headers: res.headers,
})()
// TODO: Handle script executation fails (isLeft)
if (isRight(runResult)) {
setRESTTestResults(translateToSandboxTestResults(runResult.right))
} else {
setRESTTestResults({
description: "",
expectResults: [],
tests: [],
scriptError: true,
})
}
subscription.unsubscribe()
@@ -95,7 +101,9 @@ function translateToSandboxTestResults(
}
}
return {
description: "",
expectResults: testDesc.expectResults,
tests: testDesc.children.map(translateChildTests),
scriptError: false,
}
}