From 2d60fb298a077869536f0983dad8bfd8db005685 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Wed, 4 Jan 2023 17:26:17 -0300 Subject: [PATCH] tests: solved testPendingCredential in oauth2 --- packages/oauth2/oauth2_tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/oauth2/oauth2_tests.js b/packages/oauth2/oauth2_tests.js index 49b94f4eb0..53d25a5c6a 100644 --- a/packages/oauth2/oauth2_tests.js +++ b/packages/oauth2/oauth2_tests.js @@ -6,7 +6,7 @@ const testPendingCredential = async function (test, method) { const credentialToken = Random.id(); const serviceName = Random.id(); - ServiceConfiguration.configurations.insert({service: serviceName}); + await ServiceConfiguration.configurations.insert({service: serviceName}); try { // register a fake login service @@ -55,7 +55,7 @@ const testPendingCredential = async function (test, method) { const credentialSecret = respData; // Test that the result for the token is available - let result = OAuth._retrievePendingCredential(credentialToken, + let result = await OAuth._retrievePendingCredential(credentialToken, credentialSecret); const serviceData = OAuth.openSecrets(result.serviceData); test.equal(result.serviceName, serviceName); @@ -64,7 +64,7 @@ const testPendingCredential = async function (test, method) { test.equal(result.options.option1, foobookOption1); // Test that pending credential is removed after being retrieved - result = OAuth._retrievePendingCredential(credentialToken); + result = await OAuth._retrievePendingCredential(credentialToken); test.isUndefined(result); } finally {