Skip to content

Commit

Permalink
Fix RWC missing file detection (#46673)
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham authored Nov 9, 2021
1 parent e040e85 commit 4a065f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/harness/harnessIO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4a065f5

Please sign in to comment.