MCPcopy
hub / github.com/ampproject/amphtml / mockExternalMessages

Function mockExternalMessages

test/unit/utils/test-log.js:676–681  ·  view source on GitHub ↗
(messageTemplates)

Source from the content-addressed store, hash-verified

674 const syncResolve = (v) => ({then: (cb) => cb(v)});
675
676 function mockExternalMessages(messageTemplates) {
677 win.fetch = () =>
678 syncResolve({json: () => syncResolve(messageTemplates)});
679
680 log.fetchExternalMessagesOnce_();
681 }
682
683 beforeEach(() => {
684 log = new Log(win, RETURNS_FINE);

Callers 1

test-log.jsFile · 0.85

Calls 1

syncResolveFunction · 0.85

Tested by

no test coverage detected