Consider the following typescript files:
- A.ts
export const funcA = ()=>{}
- B.ts
export const funcB = ()=>{}
- index.ts
export * from './A.ts'
export * from './B.ts'
Now in my tests, if I import the inner file directly, I am able to mock its members:
import * as A from './A.ts'
sinon.stub(A,'funcA');
However, if I import the index, it won't let me mock its members:
import * as myModule from `./index.ts`
sinon.stub(myModule,'funcA'); // does not work
Can someone explain? Is there a different approach?