Skip to content

Commit

Permalink
test: update test server for new node version
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Mar 13, 2024
1 parent 1296c77 commit d05b0c2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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("");
Expand Down

0 comments on commit d05b0c2

Please sign in to comment.