From c4e0baaaaaf503f9b67c9b0b02a414e94f2351d5 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Wed, 28 Dec 2022 14:15:00 -0300 Subject: [PATCH] tests: solved pendingCredential handles Meteor.Errors --- packages/oauth/oauth_tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/oauth/oauth_tests.js b/packages/oauth/oauth_tests.js index 73d02c8af9..a4389bd3b5 100644 --- a/packages/oauth/oauth_tests.js +++ b/packages/oauth/oauth_tests.js @@ -13,15 +13,15 @@ Tinytest.addAsync("oauth - pendingCredential handles Errors", test.equal(result.stack, testError.stack); }); -Tinytest.add("oauth - pendingCredential handles Meteor.Errors", test => { +Tinytest.addAsync("oauth - pendingCredential handles Meteor.Errors", async test => { const credentialToken = Random.id(); const testError = new Meteor.Error(401, "This is a test error"); testError.stack = 'test stack'; - OAuth._storePendingCredential(credentialToken, testError); + await OAuth._storePendingCredential(credentialToken, testError); // Test that the result for the token is the expected error - const result = OAuth._retrievePendingCredential(credentialToken); + const result = await OAuth._retrievePendingCredential(credentialToken); test.instanceOf(result, Meteor.Error); test.equal(result.error, testError.error); test.equal(result.message, testError.message);