tests: fix memory leaks (#2389)

This commit is contained in:
Mo
2023-08-06 15:23:31 -05:00
committed by GitHub
parent d59e1befff
commit 8655bdb5dd
76 changed files with 3904 additions and 3840 deletions

View File

@@ -7,24 +7,23 @@ describe('public key cryptography', function () {
this.timeout(Factory.TwentySecondTimeout)
let context
let sessions
let encryption
afterEach(async function () {
await context.deinit()
localStorage.clear()
})
beforeEach(async function () {
beforeEach(async () => {
localStorage.clear()
context = await Factory.createVaultsContextWithRealCrypto()
await context.launch()
await context.register()
})
sessions = context.application.sessions
encryption = context.encryption
afterEach(async () => {
await context.deinit()
localStorage.clear()
sinon.restore()
context = undefined
})
it('should create keypair during registration', () => {
@@ -38,7 +37,7 @@ describe('public key cryptography', function () {
it('should populate keypair during sign in', async () => {
const email = context.email
const password = context.password
await context.signout()
await context.deinit()
const recreatedContext = await Factory.createVaultsContextWithRealCrypto()
await recreatedContext.launch()