Unverified Commit 325b3a96 authored by Alex Castle's avatar Alex Castle Committed by GitHub

Don't test image domains in test env (#26502)

fixes #21549
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent e969d226
...@@ -703,7 +703,10 @@ function defaultLoader({ ...@@ -703,7 +703,10 @@ function defaultLoader({
) )
} }
if (!configDomains.includes(parsedSrc.hostname)) { if (
process.env.NODE_ENV !== 'test' &&
!configDomains.includes(parsedSrc.hostname)
) {
throw new Error( throw new Error(
`Invalid src prop (${src}) on \`next/image\`, hostname "${parsedSrc.hostname}" is not configured under images in your \`next.config.js\`\n` + `Invalid src prop (${src}) on \`next/image\`, hostname "${parsedSrc.hostname}" is not configured under images in your \`next.config.js\`\n` +
`See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host` `See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment