Zora + pta doesn't work with top level dynamic imports
See original GitHub issueRight now PTA reporter depends on all tests to be registered before the register
function executes. It causes a race condition. We are using a framework which ends up importing tests like this:
import("test.mjs").catch(e => {
if (e.code !== "ERR_MODULE_NOT_FOUND") {
return Promise.reject(e);
}
});
In that case, pta only works if synchronous module resolution for other tests (which are not using that framework) takes long enough for the promise above to be resolved. It’s a horrible race condition to have. In my opinion, the reporting step should only be concluded on beforeExit. If that was the case, dynamic imports would work as intended in this case.
https://nodejs.org/api/process.html#event-beforeexit
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Issues · lorenzofox3/zora
Issues list ; Example of cleaner ts-node setup with pta + TypeScript documentation. #157 opened ; Zora + pta doesn't work with top...
Read more >how to handle dynamic import for a const value using top ...
When I use await method in toplevel to export a const value i am getting error as "cannot use keyword await outside of...
Read more >1540913 - Dynamic module import doesn't work in a worker
Attempting to import an ES6 module inside a worker fails with "SyntaxError: dynamic module import is not implemented". javascript.options.
Read more >wjG - River Thames Conditions - Environment Agency - GOV.UK
Top ten air force world 2011, Metallica lead singer burned, Caregiver safety ... Salmanaim, Selbstsichernder knoten, Rayen stadium project, Problem solvers ...
Read more >ejW - EVOLVE - eduFOCUS
Bruce's price is right intro, Hgfhfhfh? Men's floor final 2014, ... Wellington college fees 2013, Msn news live tile not working, Gyliano van...
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 FreeTop 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
Top GitHub Comments
I created a mock PR
Thanks, I have left a comment (I am not convinced this would solve the problem). It would be great if you could share an example of a test suite which reproduces the problem so I can eventually provide a solution