From d05b0c23667f499b3eb21e60caa69c00bd7b1ba4 Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Wed, 13 Mar 2024 21:22:43 +0100 Subject: [PATCH] test: update test server for new node version --- test/server/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/server/index.js b/test/server/index.js index dfecaddf..4169428d 100644 --- a/test/server/index.js +++ b/test/server/index.js @@ -44,6 +44,12 @@ try { // Ignored } +let UserMetaDataRecipeRaw; +try { + UserMetaDataRecipeRaw = require("supertokens-node/lib/build/recipe/usermetadata/recipe").default; +} catch { + // Ignored +} let noOfTimesRefreshCalledDuringTest = 0; let noOfTimesGetSessionCalledDuringTest = 0; let noOfTimesRefreshAttemptedDuringTest = 0; @@ -274,6 +280,10 @@ app.post("/startST", async (req, res) => { if (MultiTenancyRecipeRaw) { MultiTenancyRecipeRaw.reset(); } + if (UserMetaDataRecipeRaw !== undefined) { + UserMetaDataRecipeRaw.reset(); + } + SuperTokens.init(getConfig(enableAntiCsrf, enableJWT)); } let pid = await startST(); @@ -300,6 +310,9 @@ app.post("/reinitialiseBackendConfig", async (req, res) => { if (MultiTenancyRecipeRaw) { MultiTenancyRecipeRaw.reset(); } + if (UserMetaDataRecipeRaw !== undefined) { + UserMetaDataRecipeRaw.reset(); + } SuperTokens.init(getConfig(lastSetEnableAntiCSRF, currentEnableJWT, jwtPropertyName)); res.send("");