We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d977253 commit 1efd1a6Copy full SHA for 1efd1a6
2 files changed
test/fixture/routes/replace.ts
@@ -1,5 +1,5 @@
1
-function foo(options) {
2
- const { window: window$1 = globalThis } = options;
3
-
4
- return typeof window$1 === "function";
5
-}
+export default defineHandler((event) => {
+ // #3672
+ const { window: window$1 = globalThis } = {};
+ return { window: typeof window$1 === "function" };
+});
test/tests.ts
@@ -334,6 +334,11 @@ export function testNitro(
334
expect(data).toMatch("<h1 >Hello JSX!</h1>");
335
});
336
337
+ it("replace", async () => {
338
+ const { data } = await callHandler({ url: "/replace" });
339
+ expect(data).toMatchObject({ window: false });
340
+ });
341
+
342
it.runIf(ctx.nitro?.options.serveStatic)(
343
"handles custom Vary header",
344
async () => {
0 commit comments