test(Windows): fix failing tests on Windows
This commit is contained in:
committed by
Jason Dreyzehner
parent
3fd758eb54
commit
a66193547b
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user