marchaos / jest-mock-extended

Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
MIT License
845 stars 59 forks source link

boolean field mock changes to function on access #30

Closed FreifeldRoyi closed 4 years ago

FreifeldRoyi commented 4 years ago

After defining a mock for a class with values

const mock = mock<MyClass>({ b: false, s: 'someText' }); // option 1
...
const mock = mock<MyClass>(); // option 2
mock.b = false

and accessing it with mock.b the field changes to a function mockConstructor () .... What's even more weird is that mock.s returns someText as expected

marchaos commented 4 years ago

Pr open for this.