Fix test failures on Windows related to path separators

This commit is contained in:
Henry Mercer 2022-06-16 16:21:19 -07:00
parent 79ec03f3e5
commit 4792297702
9 changed files with 100 additions and 65 deletions

View file

@ -137,7 +137,7 @@ function testResolveUriToFile(uri, index, artifactsURIs) {
// should generally always be the case so this is fine.
const cwd = process.cwd();
const filepath = __filename;
t.true(filepath.startsWith(`${cwd}/`));
t.true(filepath.startsWith(cwd + path.sep));
const relativeFilepath = filepath.substring(cwd.length + 1);
// Absolute paths are unmodified
t.is(testResolveUriToFile(filepath, undefined, []), filepath);