Skip to content

Commit

Permalink
Fix next/jest when testing next/future/image (#38569)
Browse files Browse the repository at this point in the history
- Fixes #38383 
- Similar to a previous fix in #26502
  • Loading branch information
styfle committed Jul 13, 2022
1 parent 62f3f87 commit 53bc5b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/client/future/image.tsx
Expand Up @@ -301,7 +301,7 @@ export default function Image({
blurDataURL,
...all
}: ImageProps) {
if (!experimentalFuture) {
if (!experimentalFuture && process.env.NODE_ENV !== 'test') {
throw new Error(
`The "next/future/image" component is experimental and may be subject to breaking changes. To enable this experiment, please include \`experimental: { images: { allowFutureImage: true } }\` in your next.config.js file.`
)
Expand Down

0 comments on commit 53bc5b3

Please sign in to comment.