Skip to content

Commit

Permalink
improve DX: crash when test not setup
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Sep 27, 2022
1 parent a997ff1 commit bd3b09a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions e2e/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ const runTestsOnBranch = async (branch, baselineOrCompare) => {
// collect results while tests are being executed
server.addTestResultListener((testResult) => {
if (testResult.error != null) {
Logger.info(`Test '${testResult.name}' failed with error: ${testResult.error}`);
return;
throw new Error(`Test '${testResult.name}' failed with error: ${testResult.error}`);
}
if (testResult.duration < 0) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/E2E/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const submitTestResults = testResult => fetch(`${SERVER_ADDRESS}${Routes.testRes
body: JSON.stringify(testResult),
}).then((res) => {
if (res.statusCode === 200) {
console.debug(`[E2E] Test result ${testResult.name} submitted successfully`);
console.debug(`[E2E] Test result '${testResult.name}' submitted successfully`);
return;
}
const errorMsg = `Test result submission failed with status code ${res.statusCode}`;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/E2E/reactNativeLaunchingTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ E2EClient.getTestConfig().then((config) => {
// instead of throwing, report the error to the server, which is better for DX
return E2EClient.submitTestResults({
name: config.name,
error: `Test ${config.name} not found`,
error: `Test '${config.name}' not found`,
});
}
console.debug(`[E2E] Configured for test ${config.name}. Waiting for app to become ready`);
Expand Down

0 comments on commit bd3b09a

Please sign in to comment.