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

Function testElementR1

testing/element-v1.js:125–134  ·  view source on GitHub ↗
(implClass, options = {})

Source from the content-addressed store, hash-verified

123 * }=} options
124 */
125export function testElementR1(implClass, options = {}) {
126 const exceptions = options.exceptions || [];
127 RULES.forEach(({name, notes, test}) => {
128 if (exceptions.includes(name)) {
129 expect(test(implClass), 'unused exception: ' + name).to.be.false;
130 } else {
131 expect(test(implClass), name + (notes ? `. ${notes}` : '')).to.be.true;
132 }
133 });
134}
135
136/**
137 * Returns `true` if the class's source contains the given substring.

Callers 2

test-amp-img-v1.jsFile · 0.90

Calls 3

expectFunction · 0.85
testFunction · 0.50
forEachMethod · 0.45

Tested by

no test coverage detected