Skip to content

Commit

Permalink
Refactor testAuth function to handle defaultToEmptyStringForUser auth…
Browse files Browse the repository at this point in the history
… option
  • Loading branch information
jNullj committed Mar 24, 2024
1 parent 87c68e2 commit 8c38355
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/test-helpers.js
Expand Up @@ -280,7 +280,11 @@ async function testAuth(serviceClass, authMethod, dummyResponse, options = {}) {
}

const auth = { ...serviceClass.auth, ...authOverride }
const fakeUser = auth.userKey ? 'fake-user' : undefined
const fakeUser = auth.userKey
? 'fake-user'
: auth.defaultToEmptyStringForUser
? ''
: undefined
const fakeSecret = auth.passKey ? 'fake-secret' : undefined
if (!fakeUser && !fakeSecret) {
throw new TypeError(
Expand Down

0 comments on commit 8c38355

Please sign in to comment.