FormidableLabs / jest-next-dynamic

Resolve Next.js dynamic import components in Jest tests
MIT License
69 stars 7 forks source link

Enqueue initializer functions instead of triggering import promises immediately #1

Closed exogen closed 5 years ago

exogen commented 5 years ago

Instead of calling preload on each dynamic component as it's created, we instead enqueue a function that will call preload. This will defer the actual loading until the developer calls preloadAll.