Skip to content

Commit af99265

Browse files
committed
fix test
1 parent b670497 commit af99265

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

packages/@apphosting/adapter-nextjs/src/overrides.spec.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,24 @@ describe("route overrides", () => {
167167
describe("next config overrides", () => {
168168
let tmpDir: string;
169169
const nextConfigOverrideBody = `
170-
// This file was automatically generated by Firebase App Hosting adapter
171-
const fahOptimizedConfig = (config) => ({
172-
...config,
173-
images: {
174-
...(config.images || {}),
175-
...(config.images?.unoptimized === undefined ? { unoptimized: true } : {}),
176-
},
177-
});
170+
// This file was automatically generated by Firebase App Hosting adapter
171+
const fahOptimizedConfig = (config) => ({
172+
...config,
173+
images: {
174+
...(config.images || {}),
175+
...(config.images?.unoptimized === undefined && config.images?.loader === undefined
176+
? { unoptimized: true }
177+
: {}),
178+
},
179+
});
178180
179-
const config = typeof originalConfig === 'function'
180-
? (...args) => {
181-
const resolvedConfig = originalConfig(...args);
182-
return fahOptimizedConfig(resolvedConfig);
183-
}
184-
: fahOptimizedConfig(originalConfig);
185-
`;
181+
const config = typeof originalConfig === 'function'
182+
? (...args) => {
183+
const resolvedConfig = originalConfig(...args);
184+
return fahOptimizedConfig(resolvedConfig);
185+
}
186+
: fahOptimizedConfig(originalConfig);
187+
`;
186188

187189
beforeEach(() => {
188190
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "test-overrides"));

0 commit comments

Comments
 (0)