-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
ExternalRelates to another program, environment, or user action which we cannot control.Relates to another program, environment, or user action which we cannot control.
Description
TypeScript Version: 3.9.2, 3.9.3
Search Terms: sinon, stub
Code
// file: ./src/stubber/index.ts
export { toStub } from './to-stub'
// file: ./src/stubber/to-stub.ts
export const toStub = () => {
console.log('real stub')
}
// file: ./src/start.ts
import * as sinon from 'sinon'
import * as stubber from './stubber'
(async () => {
sinon.stub(stubber, 'toStub').callsFake(() => {
console.log('fake stub')
})
stubber.toStub()
})()Run the start.ts script by compiling it with tsc or simply use ts-node.
I'd expect it print fake stub but now it prints real stub. It's working as expected for [email protected] or lower, start breaking from 3.9.2.
Expected behavior:
Print "fake stub"
Actual behavior:
Print "real stub"
Playground Link: Can't provide Playground link because it contains multiple files
Related Issues: Nope
merlinnot, squidfunk, adjerbetian, TrueWill, denieler and 7 more
Metadata
Metadata
Assignees
Labels
ExternalRelates to another program, environment, or user action which we cannot control.Relates to another program, environment, or user action which we cannot control.