Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] jest-preset: handle static assets for next/image #2763

Merged
merged 4 commits into from
Oct 1, 2021

Conversation

beerose
Copy link
Contributor

@beerose beerose commented Sep 30, 2021

Closes: blitz-js/legacy-framework#293

What are the changes and their implications?

Previously, when unit testing a component that uses next/image, we'd get an error that mocked test-file-stub string is not a valid argument — we were handing all types of static assets by replacing the import with test-file-stub. This PR handles files with extensions supported by next/image differently. Though, it's still possible to do manual mocks, and/or test real images. More context in the issue.

Open for feedback and alternative solutions.

Bug Checklist

  • Integration test added (see test docs if needed)

Feature Checklist

kodiakhq[bot]
kodiakhq bot previously approved these changes Sep 30, 2021
@beerose beerose merged commit 99f146e into canary Oct 1, 2021
@beerose beerose deleted the fix-jest-next-images branch October 1, 2021 06:25
@itsdillon itsdillon changed the title jest-preset: handle static assets for next/image [legacy-framework] jest-preset: handle static assets for next/image Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index page test fails on newly generated app
3 participants