MCPcopy Index your code
hub / github.com/ampproject/amphtml / mockWindowInterface

Function mockWindowInterface

testing/helpers/service.js:52–61  ·  view source on GitHub ↗
(sandbox)

Source from the content-addressed store, hash-verified

50}
51
52export function mockWindowInterface(sandbox) {
53 const methods = Object.getOwnPropertyNames(WindowInterface).filter(
54 (p) => typeof WindowInterface[p] === 'function'
55 );
56 const mock = {};
57 methods.forEach((method) => {
58 mock[method] = sandbox.stub(WindowInterface, method);
59 });
60 return mock;
61}
62
63/**
64 * Resolves a promise when a spy has been called a configurable number of times.

Callers 11

test-cid-api.jsFile · 0.90
setupStubsFunction · 0.90
test-linker.jsFile · 0.90
test-vendors.jsFile · 0.90
test-linker.jsFile · 0.90

Calls 2

filterMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected