From fcd2115cd703506213c429e9b9b86797ae5e7c7d Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 27 Dec 2019 15:56:45 +0200 Subject: [PATCH] chore: Conditionally set `envPath.APPDATA` for tests (#1254) Fixes test failures on Windows. Co-authored-by: Corey Farrell --- 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: