From d6684352af94396938fd34c9a378961e752e9c4c Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Fri, 27 Dec 2019 15:37:22 +0200 Subject: [PATCH] (fix) Conditionally set `envPath.APPDATA` Fixes test failures on Windows. --- test/helpers/run-nyc.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/helpers/run-nyc.js b/test/helpers/run-nyc.js index 7cb002b65..ca0adcecf 100644 --- a/test/helpers/run-nyc.js +++ b/test/helpers/run-nyc.js @@ -7,6 +7,12 @@ const envPath = { PATH: process.env.PATH } +// Work around a Windows issue with `APPDATA`, +// https://github.com/istanbuljs/nyc/issues/1248 +if ('APPDATA' in process.env) { + envPath.APPDATA = process.env.APPDATA +} + function sanitizeString (str, cwd, leavePathSep) { /* * File paths are different on different systems: