Skip to content

Commit

Permalink
Separate paths with / in resolveUriToFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed Jun 29, 2022
1 parent c156049 commit 30681e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions lib/fingerprints.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/fingerprints.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/fingerprints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ test("resolveUriToFile", (t) => {
// so we need to give it real files to look at. We will use this file as an example.
// For this to work we require the current working directory to be a parent, but this
// should generally always be the case so this is fine.
const cwd = process.cwd();
const filepath = __filename;
t.true(filepath.startsWith(cwd + path.sep));
const relativeFilepath = filepath.substring(cwd.length + 1);
const filepath = __filename.split(path.sep).join("/");
const relativeFilepath = path
.relative(process.cwd(), __filename)
.split(path.sep)
.join("/");

// Absolute paths are unmodified
t.is(testResolveUriToFile(filepath, undefined, []), filepath);
Expand Down

0 comments on commit 30681e7

Please sign in to comment.