Skip to content

Commit

Permalink
fix: better UTAM before test error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Sep 20, 2023
1 parent 3190371 commit 18096e5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions force-app/test/utam/utam-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ export async function logInSalesforce() {
// Check environment variables
['SALESFORCE_LOGIN_URL', 'SALESFORCE_LOGIN_TIME'].forEach((varName) => {
if (!process.env[varName]) {
console.error(`Missing ${varName} environment variable`);
process.exit(-1);
throw new Error(`Missing ${varName} environment variable`);
}
});
const { SALESFORCE_LOGIN_URL, SALESFORCE_LOGIN_TIME } = process.env;
Expand All @@ -19,10 +18,9 @@ export async function logInSalesforce() {
new Date().getTime() - parseInt(SALESFORCE_LOGIN_TIME, 10) >
SESSION_TIMEOUT
) {
console.error(
`ERROR: Salesforce session timed out. Re-authenticate before running tests.`
throw new Error(
`Salesforce session timed out. Re-authenticate before running tests.`
);
process.exit(-1);
}

// Navigate to login URL
Expand Down

0 comments on commit 18096e5

Please sign in to comment.