From ae5d38992073a9491d94e1ad6529ffb058a04762 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 9 Nov 2021 10:41:18 -0800 Subject: [PATCH] Fix RWC missing file detection (#46673) --- src/harness/harnessIO.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index bf9f45d8826b4..0f1647b729427 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -1438,14 +1438,15 @@ namespace Harness { } const referenceDir = referencePath(relativeFileBase, opts && opts.Baselinefolder, opts && opts.Subfolder); - let existing = IO.readDirectory(referenceDir, referencedExtensions || [extension]); + let existing = IO.readDirectory(referenceDir, referencedExtensions || [extension]); // always an _absolute_ path if (extension === ".ts" || referencedExtensions && referencedExtensions.indexOf(".ts") > -1 && referencedExtensions.indexOf(".d.ts") === -1) { // special-case and filter .d.ts out of .ts results existing = existing.filter(f => !ts.endsWith(f, ".d.ts")); } const missing: string[] = []; + const absoluteTestDir = `${process.cwd()}/${referenceDir}`; for (const name of existing) { - const localCopy = name.substring(referenceDir.length - relativeFileBase.length); + const localCopy = name.substring(absoluteTestDir.length - relativeFileBase.length); if (!writtenFiles.has(localCopy)) { missing.push(localCopy); }