Esm: 3.2.0 -> 3.2.1 stubbing no longer works

Created on 13 Feb 2019  路  5Comments  路  Source: standard-things/esm

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?

bug

All 5 comments

Hi @Wildhoney!

Could you create a simple repro repo to demonstrate the issue?

Voila.

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.

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 馃帀

Was this page helpful?
0 / 5 - 0 ratings