From 76c843516726a1a90eee91ca833bcceda62fc4dc Mon Sep 17 00:00:00 2001 From: bwang Date: Thu, 28 Apr 2022 14:54:14 -0500 Subject: [PATCH] Fix a11y test runner setup issue Change-Id: Ib6b41ba0410dacf6a13d9fe64bf60eb5b84b9e07 --- tests/a11y/runA11yTests.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/a11y/runA11yTests.js b/tests/a11y/runA11yTests.js index 6228edef..42995290 100644 --- a/tests/a11y/runA11yTests.js +++ b/tests/a11y/runA11yTests.js @@ -14,7 +14,9 @@ const config = require( path.resolve( __dirname, 'a11y.config.js' ) ); */ function resetReportDir() { // Delete and create report directory - fs.rmSync( config.reportDir, { recursive: true } ); + if ( fs.existsSync( config.reportDir ) ) { + fs.rmSync( config.reportDir, { recursive: true } ); + } fs.mkdirSync( config.reportDir, { recursive: true } ); }