Testing EcmaScript Modules
summary
Three tools target ESM mocking and testing: lazaretto uses a worker thread and stringified mock functions to load candidate code and allow white‑box checks; mockalicious runs tests inside a worker, injects mocks via a custom loader and implements cache‑busting for file:// imports; loader API experimental remains required, so every run either needs --loader or an autoload worker shim. Coverage with nyc breaks; use c8. Result: workable but fragile and not ready for most production workflows.
AI-written summary · about
chapters (15)
- 0:00Start
- 3:24Dynamic Import
- 3:46Ecmascript Modules
- 12:15Ecosystem
- 17:49Test Libraries and Test Frameworks
- 18:48Test Library
- 22:38Mocking Dependencies
- 26:00Loaders Api
- 29:37Worker Threads
- 34:52The Api
- 39:39Cache Busting
- 46:52Tapex
- 48:49Is Esm Ready
- 51:57Conditional Exports
- 52:32Conclusion
related talks
22mESM Loaders: Enhancing Module Loading in Node.js
27mTrusted JavaScript Language Environments with ESMeta
48mTomorrow's ES modules today
30mESM Loaders: Enhancing Module Loading in Node.js
32mPlease Wait... Loading: A Talk of Two Loaders
34mTowards a simpler JavaScript ecosystem
36mMigrating Babel from CommonJS to ESM
32mES Modules in Node JS
