1
0
mirror of synced 2025-11-08 12:57:47 +00:00

test(Windows): fix failing tests on Windows

This commit is contained in:
Andrew Bradley
2018-03-13 17:43:44 -04:00
committed by Jason Dreyzehner
parent 3fd758eb54
commit a66193547b

View File

@@ -108,16 +108,21 @@ async function hashAllTheThings(
const hashes = await Promise.all(hashAll);
return hashes.reduce<{ readonly [filename: string]: string }>(
(acc, hash, i) => {
const trimmedFilePath = relative(buildDir, filePaths[i]);
const trimmedNormalizedFilePath = normalizePath(relative(buildDir, filePaths[i]));
return {
...acc,
[trimmedFilePath]: hash
[trimmedNormalizedFilePath]: hash
};
},
{}
);
}
// On Windows, convert backslashes to forward slashes
function normalizePath(p: string) {
return process.platform === 'win32' ? p.replace(/\\/g, '/') : p;
}
test(`${
TestDirectories.one
}: parses CLI arguments, handles default options`, async t => {