-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Properly export module resolver (#34)
* Fix: Properly export module resolver * fix: Export `resolve` function directly * Chore: Add tests Signed-off-by: Richie Bendall <richiebendall@gmail.com> * Export `ModuleResolver` instead Signed-off-by: Richie Bendall <richiebendall@gmail.com> * Use better test names Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
- Loading branch information
1 parent
62ea4bd
commit aa38ef4
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @fileoverview Tests for relative module resolver. | ||
*/ | ||
"use strict"; | ||
|
||
const { | ||
Legacy: { | ||
ModuleResolver | ||
} | ||
} = require("../../.."); | ||
const { assert } = require("chai"); | ||
const path = require("path"); | ||
|
||
describe("ModuleResolver", () => { | ||
describe("resolve()", () => { | ||
it("should correctly resolve a relative path", () => { | ||
assert.strictEqual( | ||
ModuleResolver.resolve( | ||
"./file2.js", | ||
path.resolve("./tests/fixtures/relative-module-resolver/file.js") | ||
), | ||
path.resolve("./tests/fixtures/relative-module-resolver/file2.js") | ||
); | ||
}); | ||
}); | ||
}); |