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

Function shouldFail

test/integration/test-errors.js:50–64  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

48 });
49
50 function shouldFail(id) {
51 // Skip for issue #110
52 it.configure()
53 .ifChrome()
54 .run('should fail to load #' + id, () => {
55 const e = fixture.doc.getElementById(id);
56 expect(fixture.errors.join('\n')).to.contain(
57 e.getAttribute('data-expectederror')
58 );
59 expect(e.getAttribute('error-message')).to.contain(
60 e.getAttribute('data-expectederror')
61 );
62 expect(e.className).to.contain('i-amphtml-element-error');
63 });
64 }
65
66 // Add cases to fixtures/errors.html and add them here.
67 shouldFail('yt0');

Callers 1

test-errors.jsFile · 0.85

Calls 6

expectFunction · 0.85
ifChromeMethod · 0.80
configureMethod · 0.80
getAttributeMethod · 0.80
runMethod · 0.45
getElementByIdMethod · 0.45

Tested by

no test coverage detected