Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ahabhgk committed Apr 24, 2024
1 parent 9a3b6bb commit 748ce9b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/rspack/tests/configCases/resolve/roots/dir/a.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'a'
1 change: 1 addition & 0 deletions packages/rspack/tests/configCases/resolve/roots/dir2/b.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "b"
8 changes: 8 additions & 0 deletions packages/rspack/tests/configCases/resolve/roots/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import a from "/dir/a";

it("should support roots", async () => {
expect(a).toBe("a");
const b = "b"; // keep /dir2/ as a context module
const m = await import("/dir2/" + b);
expect(m.default).toBe("b")
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
context: __dirname,
}

0 comments on commit 748ce9b

Please sign in to comment.