Skip to content

Commit

Permalink
remove use of experimental fs.promises api
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Dec 17, 2019
1 parent 022e6c4 commit 18722e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utilities/visual_regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand All @@ -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);
Expand Down

0 comments on commit 18722e7

Please sign in to comment.