You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defer importing ky-universal until actually needed
This accomplishes two things:
* It prevents a dangling promise with an import in it. If the module is
loaded (queuing up the import promise) and then no clients are ever
used, and thus never awaited, the import can happen too late. In
particular, Jest will break if the import happens after the test is
complete.
* It avoids a dynamic import altogether when the client isn't needed. In
particular, Jest uses Node's VM API which only experimentally supports
dynamic imports (and ESM modules altogether). This change means that
merely loading the http-client module doesn't require enabling that
experimental support.
0 commit comments