Skip to content

Commit

Permalink
fix #197: put guard around call to sync cleanup callback
Browse files Browse the repository at this point in the history
  • Loading branch information
silkentrance committed Jan 27, 2020
1 parent ab14623 commit e443617
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/inband-standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ function inbandStandardTests(testOpts, opts, isFile, beforeHook, sync = false) {

if (sync) {
it('should have a working removeCallback', function () {
assert.ok(typeof this.topic.removeCallback === 'function');
// important: remove file or dir unconditionally
rimraf.sync(this.topic.name);
try {
assert.ok(typeof this.topic.removeCallback === 'function');
this.topic.removeCallback();
} finally {
// important: remove file or dir unconditionally
rimraf.sync(this.topic.name);
}
}.bind(topic));
} else {
it('should have a working removeCallback', function (done) {
Expand Down

0 comments on commit e443617

Please sign in to comment.