From 8c38355fca6ddededa39820591b92444104d1ca9 Mon Sep 17 00:00:00 2001 From: jNullj <15849761+jNullj@users.noreply.github.com> Date: Sun, 24 Mar 2024 22:58:37 +0200 Subject: [PATCH] Refactor testAuth function to handle defaultToEmptyStringForUser auth option --- services/test-helpers.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/test-helpers.js b/services/test-helpers.js index a8944e5dc1556..1640e12c7f3d6 100644 --- a/services/test-helpers.js +++ b/services/test-helpers.js @@ -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(