blob: 81d82e149f32ab43265cf0f6237de28755a4c969 [file] [log] [blame]
import { Page } from 'puppeteer';
import * as pg from './page';
import * as unit from './unit.page';
/**
* prepare gets the /golang.org/x/tools@v0.1.1 frontend page ready for snapshot
* tests by rewriting highly variable page content to constant values.
* @param page The page to prepare
*/
export async function prepare(page: Page): Promise<void> {
await unit.prepare(page);
await pg.$$eval(page, pg.select('UnitHeader-imports', 'a'), els =>
els.map(el => (el.innerHTML = 'Imports: 0'))
);
}