chore: fix undefined rm in mocha-utils (#5920)

Closes #5916.
This commit is contained in:
Jack Franklin 2020-05-26 15:37:39 +01:00 committed by GitHub
parent 6cfe142af1
commit 24ac11e76e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,8 @@ const os = require('os');
const sinon = require('sinon');
const puppeteer = require('../');
const utils = require('./utils');
const rimraf = require('rimraf');
const { trackCoverage } = require('./coverage-utils');
const setupServer = async () => {
@ -82,7 +84,7 @@ const setupGoldenAssertions = () => {
const suffix = product.toLowerCase();
const GOLDEN_DIR = path.join(__dirname, 'golden-' + suffix);
const OUTPUT_DIR = path.join(__dirname, 'output-' + suffix);
if (fs.existsSync(OUTPUT_DIR)) rm(OUTPUT_DIR);
if (fs.existsSync(OUTPUT_DIR)) rimraf.sync(OUTPUT_DIR);
utils.extendExpectWithToBeGolden(GOLDEN_DIR, OUTPUT_DIR);
};