Skip to content

Commit

Permalink
Prevent test from bleeding into the global expect
Browse files Browse the repository at this point in the history
(cherry picked from commit e392ce5)
  • Loading branch information
papandreou committed Apr 25, 2022
1 parent 0ad1bb0 commit 16e4b28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/api/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ describe('hook', () => {

// Regression test for https://gitter.im/unexpectedjs/unexpected?at=5fb42b73747be107c1c76095
it('should not break `this` in clones created after installing the hook', function () {
expect.hook(function (next) {
const parentExpect = expect.clone();
parentExpect.hook(function (next) {
return function (context, ...rest) {
return next(context, ...rest);
};
Expand Down

0 comments on commit 16e4b28

Please sign in to comment.