Skip to content

Commit

Permalink
refactor(jest-mock): remove useless conditional (#13561)
Browse files Browse the repository at this point in the history
* refactor(jest-mock): remove useless conditional

* Update CHANGELOG.md

Co-authored-by: Tim Seckinger <seckinger.tim@gmail.com>
  • Loading branch information
Fdawgs and jeysal committed Nov 5, 2022
1 parent 4670d3b commit bb28e79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/jest-mock/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ export class ModuleMocker {
const boundFunctionPrefix = 'bound ';
let bindCall = '';
// if-do-while for perf reasons. The common case is for the if to fail.
if (name && name.startsWith(boundFunctionPrefix)) {
if (name.startsWith(boundFunctionPrefix)) {
do {
name = name.substring(boundFunctionPrefix.length);
// Call bind() just to alter the function name.
Expand Down

0 comments on commit bb28e79

Please sign in to comment.