Skip to content

Commit

Permalink
Check _isMockFunction is true rather than truthy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ristea committed Sep 21, 2018
1 parent ee751bf commit a851e42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `[jest-haste-map]` Fixed Haste whitelist generation for scoped modules on Windows ([#6980](https://github.com/facebook/jest/pull/6980))
- `[jest-mock]` Fix inheritance of static properties and methods in mocks ([#7003](https://github.com/facebook/jest/pull/7003))
- `[jest-mock]` Fix mocking objects without `Object.prototype` in their prototype chain ([#7003](https://github.com/facebook/jest/pull/7003))
- `[jest-runtime]` Check `globalMock._isMockFunction` is true rather than truthy ([#7017](https://github.com/facebook/jest/pull/7017))

### Chore & Maintenance

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class Runtime {
(typeof globalMock === 'object' && globalMock !== null) ||
typeof globalMock === 'function'
) {
globalMock._isMockFunction && globalMock.mockClear();
globalMock._isMockFunction === true && globalMock.mockClear();
}
});

Expand Down

0 comments on commit a851e42

Please sign in to comment.