Skip to content

Commit

Permalink
patch(vest): remove unneeded bind in run result callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Mar 28, 2022
1 parent 2f1c5b7 commit a087969
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vest/src/core/suite/produce/produceSuiteRunResult.ts
Expand Up @@ -79,15 +79,14 @@ const done: Done = function done(...args): SuiteRunResult {
};

function deferDoneCallback(doneCallback: () => void, fieldName?: string): void {
const deferredCallback = ctx.bind({}, doneCallback);
const [, setTestCallbacks] = useTestCallbacks();
setTestCallbacks(current => {
if (fieldName) {
current.fieldCallbacks[fieldName] = (
current.fieldCallbacks[fieldName] || []
).concat(deferredCallback);
).concat(doneCallback);
} else {
current.doneCallbacks.push(deferredCallback);
current.doneCallbacks.push(doneCallback);
}
return current;
});
Expand Down

0 comments on commit a087969

Please sign in to comment.