MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / makeFakeKeyring

Function makeFakeKeyring

test/unit/modules/pgpModel.test.js:59–73  ·  view source on GitHub ↗
({decryptImpl, verifyImpl})

Source from the content-addressed store, hash-verified

57const utf8Binary = str => Uint8Array2str(new TextEncoder().encode(str));
58
59function makeFakeKeyring({decryptImpl, verifyImpl}) {
60 return {
61 getPgpBackend: () => ({
62 decrypt: decryptImpl,
63 verify: verifyImpl
64 }),
65 getPrivateKeyByIds: jest.fn(),
66 keystore: {
67 getAllKeys: jest.fn().mockReturnValue([]),
68 getKeysForId: jest.fn().mockReturnValue([])
69 },
70 getFprForKeyId: jest.fn(),
71 getKeyByAddress: jest.fn().mockResolvedValue({})
72 };
73}
74
75beforeAll(() => {
76 l10n.mapToLocal();

Callers 1

pgpModel.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected