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

Function createAmpElementForTesting

src/custom-element.js:2176–2189  ·  view source on GitHub ↗
(
  win,
  opt_implementationClass,
  opt_elementConnectedCallback
)

Source from the content-addressed store, hash-verified

2174 * @visibleForTesting
2175 */
2176export function createAmpElementForTesting(
2177 win,
2178 opt_implementationClass,
2179 opt_elementConnectedCallback
2180) {
2181 const Element = createCustomElementClass(
2182 win,
2183 opt_elementConnectedCallback || (() => {})
2184 );
2185 if (getMode().test && opt_implementationClass) {
2186 Element.prototype.implementationClassForTesting = opt_implementationClass;
2187 }
2188 return Element;
2189}
2190
2191/**
2192 * @visibleForTesting

Calls 2

getModeFunction · 0.90
createCustomElementClassFunction · 0.85

Tested by

no test coverage detected