mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* remove use of experimental fs.promises api * remove one more usage of fs.promises * switch to an alternate fs module to maintain testing strategy Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
88f8bef2fd
commit
dbf1c3c8cd
4 changed files with 33 additions and 20 deletions
|
@ -103,8 +103,8 @@ async function compareScreenshots() {
|
|||
|
||||
const diffImagePath = path.resolve(DIFF_SCREENSHOTS_DIR, screenshot);
|
||||
|
||||
const sessionImage = PNG.sync.read(await fs.promises.readFile(sessionImagePath));
|
||||
const baselineImage = PNG.sync.read(await fs.promises.readFile(baselineImagePath));
|
||||
const sessionImage = PNG.sync.read(await readFileAsync(sessionImagePath));
|
||||
const baselineImage = PNG.sync.read(await readFileAsync(baselineImagePath));
|
||||
const { width, height } = sessionImage;
|
||||
const diff = new PNG({ width, height });
|
||||
|
||||
|
@ -117,7 +117,7 @@ async function compareScreenshots() {
|
|||
{ threshold: 0 }
|
||||
);
|
||||
|
||||
await fs.promises.writeFile(diffImagePath, PNG.sync.write(diff));
|
||||
await writeFileAsync(diffImagePath, PNG.sync.write(diff));
|
||||
|
||||
const change = numDiffPixels / (width * height);
|
||||
const changePercentage = (change * 100).toFixed(2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue