import * as u from '../../utils.js';
// Later...
const cycleMiddlewareStub = stub(u, 'cycleMiddleware').throws(
() => new Error('Yoko Onoooo...')
);
In 3.2.0 the stubbing of cycleMiddleware works perfectly, but when upgrading to 3.2.1 it no longer stubs – instead it gives the original function.
Not sure if it's a bug or I'm stubbing it wrong. If I'm doing it wrong, how should I do it now?
Hi @Wildhoney!
Could you create a simple repro repo to demonstrate the issue?
Run yarn && yarn test to see the failure.
To see it passing, change esm to 3.2.0 in package.json, run yarn and re-run yarn test.
Patches https://github.com/standard-things/esm/commit/39f31aa1e8aa9b1732effc39d93e5e757a2ef528, https://github.com/standard-things/esm/commit/e2bab78750139dc8ac96bcd8602c717c3bd5db81, https://github.com/standard-things/esm/commit/2b6152dacdb2934d3fd32716c8ded953108b0a93; Test https://github.com/standard-things/esm/commit/ac5752d9dd205489c742f9a8634c33e33af51692;
Update:
Thanks @Wildhoney!
I've resolved the issue through a series of rework patches.
Thanks @jdalton – that's a sizeable code change!
Is 3.2.4 the new version? As I've upgraded it in the repo and still get the same issue.
I have not published the release yet. I'll ping the issue thread when I do though.
Update:
v3.2.5 is released 馃帀