chore: vault tests refactors and lint (#2374)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
/* eslint-disable no-undef */
|
||||
import FakeWebCrypto from './fake_web_crypto.js'
|
||||
import { AppContext } from './AppContext.js'
|
||||
import { VaultsContext } from './VaultsContext.js'
|
||||
import * as Applications from './Applications.js'
|
||||
import * as Defaults from './Defaults.js'
|
||||
import * as Utils from './Utils.js'
|
||||
@@ -57,6 +58,16 @@ export async function createAppContext({ identifier, crypto, email, password, ho
|
||||
return context
|
||||
}
|
||||
|
||||
export async function createVaultsContextWithRealCrypto(identifier) {
|
||||
return createVaultsContext({ identifier, crypto: new SNWebCrypto() })
|
||||
}
|
||||
|
||||
export async function createVaultsContext({ identifier, crypto, email, password, host } = {}) {
|
||||
const context = new VaultsContext({ identifier, crypto, email, password, host })
|
||||
await context.initialize()
|
||||
return context
|
||||
}
|
||||
|
||||
export function disableIntegrityAutoHeal(application) {
|
||||
application.sync.emitOutOfSyncRemotePayloads = () => {
|
||||
console.warn('Integrity self-healing is disabled for this test')
|
||||
@@ -288,7 +299,7 @@ export function tomorrow() {
|
||||
}
|
||||
|
||||
export async function sleep(seconds, reason) {
|
||||
console.log('Sleeping for reason', reason)
|
||||
console.log('[Factory] Sleeping for reason', reason)
|
||||
return Utils.sleep(seconds)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user