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

Function seedStorage

test/unit/modules/defaults.test.js:27–36  ·  view source on GitHub ↗
(initial = {})

Source from the content-addressed store, hash-verified

25// always returns {} for every key, which only ever exercises the new-install
26// branch.
27function seedStorage(initial = {}) {
28 const store = {...initial};
29 chrome.storage.local.get.mockImplementation(key =>
30 Promise.resolve(key in store ? {[key]: store[key]} : {}));
31 chrome.storage.local.set.mockImplementation(obj => {
32 Object.assign(store, obj);
33 return Promise.resolve();
34 });
35 return store;
36}
37
38const SEEDED_WATCH_LIST = [
39 {site: 'Example', active: true, https_only: true, frames: [{scan: true, frame: '*.example.com', api: true}]}

Callers 1

defaults.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected