Skip to content

Commit 1df032f

Browse files
committed
fix: use new instance for each tests
1 parent 42db10e commit 1df032f

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

tests/sessionTime.spec.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,25 @@ const variable: TestVariable[] = [
5757
},
5858
];
5959

60-
const storageInstance = new MemoryStorage();
6160
variable.forEach(async (testVariable) => {
6261
const { web3AuthNetwork, uxMode, manualSync, email, web3ClientID: web3AuthClientId, sessionTime, disableSessionManager } = testVariable;
6362

6463

6564
await test(`#Variable SessionTime test : ${JSON.stringify({ sessionTime: testVariable.sessionTime })} - disableSessionManager: ${disableSessionManager} client_id: ${web3AuthClientId}`, async (t) => {
66-
const coreKitInstance = new Web3AuthMPCCoreKit({
67-
web3AuthClientId,
68-
web3AuthNetwork,
69-
baseUrl: "http://localhost:3000",
70-
uxMode,
71-
tssLib,
72-
storage: storageInstance,
73-
manualSync,
74-
sessionTime,
75-
disableSessionManager,
76-
});
65+
let coreKitInstance : Web3AuthMPCCoreKit;
7766

7867
async function beforeTest() {
68+
coreKitInstance = new Web3AuthMPCCoreKit({
69+
web3AuthClientId,
70+
web3AuthNetwork,
71+
baseUrl: "http://localhost:3000",
72+
uxMode,
73+
tssLib,
74+
storage: new MemoryStorage(),
75+
manualSync,
76+
sessionTime,
77+
disableSessionManager,
78+
});
7979
if (coreKitInstance.status === COREKIT_STATUS.INITIALIZED) await criticalResetAccount(coreKitInstance);
8080
}
8181

@@ -127,7 +127,5 @@ variable.forEach(async (testVariable) => {
127127
assert.notEqual(coreKitInstance.sessionId , undefined);
128128
}
129129
});
130-
131-
132130
});
133131
});

tests/setup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const criticalResetAccount = async (coreKitInstance: Web3AuthMPCCoreKit):
3131
throw new Error("coreKitInstance is not set");
3232
}
3333

34-
await coreKitInstance.tKey.syncLocalMetadataTransitions();
3534
if (coreKitInstance.tKey.secp256k1Key) {
3635
await coreKitInstance.tKey.CRITICAL_deleteTkey();
3736
} else {

0 commit comments

Comments
 (0)