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("");