Skip to content

Commit

Permalink
🐛 Fix exports.default
Browse files Browse the repository at this point in the history
  • Loading branch information
siguici committed Mar 26, 2024
1 parent 92f4d93 commit 3b27a43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions spec/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import hello_php from "./hello.php";

it("should import PHP file", async () => {
expect(hello_php).toEqual("Hello World!");
expect(await use(`${import.meta.dir}/hello.php`, { name: "PHP" })).toEqual(
"Hello PHP!",
);
expect(await use(`${import.meta.dir}/hello.php`, { name: "PHP" })).toEqual({
default: "Hello PHP!",
});
});

it("should render PHP code", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export async function render(
Bun.write(path, code);
const render = await use(path, data, cwd, env);
unlinkSync(path);
return render;
return render.default;
}

export async function use(
Expand Down

0 comments on commit 3b27a43

Please sign in to comment.