From e44361725884c9bdd2c06e0526f41a05bf585e2f Mon Sep 17 00:00:00 2001 From: Carsten Klein Date: Mon, 27 Jan 2020 17:52:48 +0100 Subject: [PATCH] fix #197: put guard around call to sync cleanup callback --- test/inband-standard.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/inband-standard.js b/test/inband-standard.js index f787b09..41a89e5 100644 --- a/test/inband-standard.js +++ b/test/inband-standard.js @@ -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) {