Skip to content

Commit 1efd1a6

Browse files
committed
test: update replace test
1 parent d977253 commit 1efd1a6

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

test/fixture/routes/replace.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function foo(options) {
2-
const { window: window$1 = globalThis } = options;
3-
4-
return typeof window$1 === "function";
5-
}
1+
export default defineHandler((event) => {
2+
// #3672
3+
const { window: window$1 = globalThis } = {};
4+
return { window: typeof window$1 === "function" };
5+
});

test/tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@ export function testNitro(
334334
expect(data).toMatch("<h1 >Hello JSX!</h1>");
335335
});
336336

337+
it("replace", async () => {
338+
const { data } = await callHandler({ url: "/replace" });
339+
expect(data).toMatchObject({ window: false });
340+
});
341+
337342
it.runIf(ctx.nitro?.options.serveStatic)(
338343
"handles custom Vary header",
339344
async () => {

0 commit comments

Comments
 (0)