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

Function createEmptyBuild

build-system/tasks/visual-diff/index.js:575–590  ·  view source on GitHub ↗

* Creates a Percy build with only a blank page for comparison. * * Enables us to require percy checks on GitHub, and yet, not have to do a full * build for every PR. * * @param {!puppeteer.Browser} browser a Puppeteer controlled browser. * @return {Promise }

(browser)

Source from the content-addressed store, hash-verified

573 * @return {Promise<void>}
574 */
575async function createEmptyBuild(browser) {
576 log('info', 'Generating the blank page snapshot');
577
578 const page = await newPage(browser);
579
580 try {
581 await page.goto(
582 `http://${HOST}:${PORT}/examples/visual-tests/blank-page/blank.html`
583 );
584 } catch {
585 // Ignore failures
586 }
587
588 // @ts-ignore Type mismatch in library
589 await percySnapshot(page, 'Blank page', SNAPSHOT_SINGLE_BUILD_OPTIONS);
590}
591
592/**
593 * Runs the AMP visual diff tests.

Callers 1

performVisualTestsFunction · 0.85

Calls 2

newPageFunction · 0.85
logFunction · 0.70

Tested by

no test coverage detected