Cypress test for dynamic content error handling in Page component #20645
Unanswered
mr-baraiya
asked this question in
Q&A
Replies: 1 comment
-
|
Hey @mr-baraiya, This sounds like an awesome addition to the Webpack docs. Handling failed promises gracefully in dynamic imports is super important. Usually, mocking the network request in Cypress ( Let me know if you make any progress or if you need another fresh set of eyes on it! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I opened a PR to handle failed dynamic content loading safely in the Page component.
PR: webpack/webpack.js.org#8006
The change ensures that when
contentis a Promise and it fails, the component renders a safe fallback instead of causing runtime issues.I tried to add a Cypress E2E test for this behavior as requested in the PR review, but the test keeps failing in CI.
I attempted several approaches:
However, none of these approaches seem to trigger the failure scenario in Cypress.
Could you please clarify what scenario should be tested for this case, or how to properly simulate dynamic content failure in Cypress?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions