Skip to content

Commit

Permalink
add unit test to cover new scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentBailly committed Dec 10, 2024
1 parent 24b3c60 commit 44a2603
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/fallback.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ describe("fallback", function () {
const fileSystem = Volume.fromJSON(
{
"/a/index": "",
"/a/dir/index": "",
"/a/dir/index": "",

Check failure on line 11 in test/fallback.test.js

View workflow job for this annotation

GitHub Actions / lint

Replace `··` with `↹`
"/a/second/index": "",

Check failure on line 12 in test/fallback.test.js

View workflow job for this annotation

GitHub Actions / lint

Replace `··` with `↹`
"/recursive/index": "",
"/recursive/dir/index": "",
"/recursive/dir/file": "",
Expand Down Expand Up @@ -94,6 +95,11 @@ describe("fallback", function () {
expect(resolver.resolveSync({}, "/", "multiAlias/anotherDir")).toBe(
"/e/anotherDir/index"
);
// The multiAlias works as expected when the matching alias is the last one
expect(resolver.resolveSync({}, "/", "multiAlias/second")).toBe(
"/a/second/index"
);

Check failure on line 101 in test/fallback.test.js

View workflow job for this annotation

GitHub Actions / lint

Delete `⏎`

});
it("should log the correct info", done => {
const log = [];
Expand Down

0 comments on commit 44a2603

Please sign in to comment.