Skip to content

Commit

Permalink
refactor: hide isr warning in test env
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 8, 2025
1 parent f5ebb25 commit 19ec539
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/presets/netlify/legacy/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { existsSync, promises as fsp } from "node:fs";
import type { Nitro } from "nitro/types";
import { join } from "pathe";
import { isTest } from "std-env";

export async function writeRedirects(nitro: Nitro) {
const redirectsPath = join(nitro.options.output.publicDir, "_redirects");
Expand Down Expand Up @@ -124,7 +125,7 @@ export function deprecateSWR(nitro: Nitro) {
hasLegacyOptions = true;
}
}
if (hasLegacyOptions) {
if (hasLegacyOptions && !isTest) {
console.warn(
"[nitro] Nitro now uses `isr` option to configure ISR behavior on Netlify. Backwards-compatible support for `static` and `swr` support with Builder Functions will be removed in the future versions. Set `future.nativeSWR: true` nitro config disable this warning."
);
Expand Down

0 comments on commit 19ec539

Please sign in to comment.