testdouble / quibble

Makes it easy to replace require'd dependencies.
93 stars 26 forks source link

exception if using esm functionality but loader not loaded #32

Closed giltayar closed 4 years ago

giltayar commented 4 years ago

Currently, if you use quibble.esm (and other ESM methods), and yet did not use node --loader=..., the results are unpredictable. It would be better to throw an exception and notify the user.

This is what this PR does. It also adds a function isLoaderLoaded that enables other, higher-level libraries like testdouble.js to implement this themselves.

giltayar commented 4 years ago

@searls hopefully, last pr. This PR also enables testdouble.js to fail when the user is not running the loader when using td.replaceEsm, so once you merge (and publish), I'll do the finishing touches in testdouble around this, and... done!

searls commented 4 years ago

landed in 0.6.2!