getPage seems to fail on the second run
See original GitHub issue🐛 Bug Report
When i run one test with getPage() it works fine, but if i duplicate that test and run it again inside another it() i get an error.
Im trying to write multiple tests to test different state/data being sent but i can only use one getPage per test-suite
TypeError: Cannot destructure property 'getInitialProps' of 'AppComponent' as it is undefined.
at Object.fetchAppData (node_modules/next-page-tester/dist/_app/fetchAppData.js:12:13)
at Object.fetchRouteData (node_modules/next-page-tester/dist/fetchData/fetchRouteData.js:9:42)
at Object.getPageInfo (node_modules/next-page-tester/dist/makePageElement.js:24:40)
at getPage (node_modules/next-page-tester/dist/getPage.js:84:38)
Issue Analytics
- State:
- Created 3 years ago
- Comments:11
Top Results From Across the Web
Form::getPage() throws Error when returning null #518 - GitHub
When $form->getPage() is called in onFormInitialized in plugin, an Error is thrown, when page has not yet been initialized.
Read more >selenium unable to get page after opening it with python
Any page I try to open, a timeout error is returned after awhile: Traceback (most recent call last): File "C:\Users\MunteanuG\AppData\Local\ ...
Read more >Fixing the 'cannot GET /URL' error on refresh with React ...
The first, set up both client and server side routing. The second, redirect all server requests to /index.html which will download all the...
Read more >SQL Server diagnostics added to detect unreported I/O ...
In some instances, a page appears to be updated two times but with the same LSN value.
Read more >[Solved] Two web GET request in code just works one.
If you don't run out of sockets, it should run ok for a day or two. ... if(!getPage(server,serverPort,pageAdd)) Serial.print(F("Fail first ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @jasonwilliams, do your tests differ from the ones this library is tested with? Here is an example of a test file with multiple
getPagecalls.If yes would you mind providing a reproducible example?
PS. Are you calling something like
jest.resetModules()between tests?Yep @Meemaw, this was actually my issue! 👏 👏👏