If you're using sinon, my advice is to stop using it. They don't support mocking readonly modules and got pretty aggressive about the topic
https://github.com/sinonjs/sinon/issues/1711
With jest, in the other hand, you can easily mock an ES6 read-only module like this:
const myMockedModule = {
...jest.requireActual('my-es6-readonly-module'),
theFunctionIWantToMock: jest.fn(),
}
jest.mock('my-es6-readonly-module', () => myMockedModule);
You need to put it as the first line of your spec. With that approach, you can mock any direct exported item from any module, even if it is read-only, as jest intercepts the require method.
This is also not very practicable with mocha because mocha loads all tests in the same process and some other test suite may load, directly or indirectly, the module you want to mock, and it'll screw your test. Jest is the way to go, as it loads every single spec in a separated process, making one spec doesn't interfere with another, so this mocking approach become viable.