Skip to content

Commit 712971d

Browse files
committed
fix: path should be null
1 parent d8105e8 commit 712971d

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const interfaceVersion = 2;
1010
export const resolve: typeof resolveTs = function (source, file, config) {
1111
if (source.startsWith("bun:")) {
1212
log("matched bun modules:", source);
13-
return { found: true };
13+
return { found: true, path: null };
1414
}
1515
return resolveTs(source, file, config);
1616
};

test/index.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ test("interfaceVersion", () => {
55
});
66

77
test.each([
8-
{ source: "fs", found: true },
9-
{ source: "node:fs", found: true },
10-
{ source: "not_found", found: false },
11-
{ source: "bun:test", found: true },
12-
])("resolve $source => found $found", ({ source, found }) => {
13-
expect(resolve(source, "").found).toBe(found);
14-
});
8+
{ source: "fs", found: true, path: null },
9+
{ source: "node:fs", found: true, path: null },
10+
{ source: "not_found", found: false, path: undefined },
11+
{ source: "bun:test", found: true, path: null },
12+
])(
13+
"resolve $source => found: $found, path: $path",
14+
({ source, found, path }) => {
15+
const result = resolve(source, "");
16+
expect(result.found).toBe(found);
17+
expect(result.path).toBe(path);
18+
}
19+
);

0 commit comments

Comments
 (0)