Skip to content

Commit

Permalink
Reset sinon sandbox when flushing to prevent memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
stoically committed Mar 30, 2019
1 parent e506e86 commit 26c1deb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default class StubsCache extends BaseCache {
*/
flush() {
this.stubs = Object.create(null);
this.sinon.restore();
}

/**
Expand All @@ -73,5 +74,6 @@ export default class StubsCache extends BaseCache {
this.stubs[key].resetHistory();
this.stubs[key].resetBehavior();
});
this.sinon.restore();
}
}

0 comments on commit 26c1deb

Please sign in to comment.