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

Function drawBoxes

build-system/tasks/visual-diff/log.js:47–63  ·  view source on GitHub ↗

* Pretty-prints the current test status of each page. * @param {!Array<!puppeteer.Page>} allPages * @param {!Array<!puppeteer.Page>} availablePages * @param {!puppeteer.Page} thisPage * @param {string} thisPageText * @return {string}

(allPages, availablePages, thisPage, thisPageText)

Source from the content-addressed store, hash-verified

45 * @return {string}
46 */
47function drawBoxes(allPages, availablePages, thisPage, thisPageText) {
48 return (
49 '[' +
50 allPages
51 .map((page) => {
52 if (page === thisPage) {
53 return thisPageText;
54 } else if (availablePages.includes(page)) {
55 return ' ';
56 } else {
57 return yellow('█');
58 }
59 })
60 .join(' ') +
61 ']'
62 );
63}
64
65module.exports = {
66 drawBoxes,

Callers 1

snapshotWebpagesFunction · 0.85

Calls 1

yellowFunction · 0.85

Tested by

no test coverage detected