diff --git a/test/helpers.js b/test/helpers.js index b700a231d..87763c37c 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -552,11 +552,11 @@ async function assertValidator(actualValidate, expectedValidate, values) { export async function getLatestURLWithToken() { let latestURLWithToken; const start = Date.now(); - while (latestURLWithToken === undefined) { + while (!latestURLWithToken) { const response = await fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/token`); const respBody = await response.json(); latestURLWithToken = respBody.latestURLWithToken; - if (latestURLWithToken === undefined || latestURLWithToken === "") { + if (!latestURLWithToken) { if (Date.now() - start > 10000) { throw new Error("Timeout waiting for latestURLWithToken"); }