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 be5fc21 commit 119f311
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/inband-standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,16 @@ 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 {
this.topic.removeCallback();
} catch (err) {
// important: remove file or dir unconditionally
try {
rimraf.sync(this.topic.name);
} catch (_ignored) {
}
throw err;
}
}.bind(topic));
} else {
it('should have a working removeCallback', function (done) {
Expand Down

0 comments on commit 119f311

Please sign in to comment.