diff --git a/package.json b/package.json index 0c178bc..6d28fc7 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,8 @@ "node": ">=6" }, "dependencies": { - "rimraf": "^2.6.2" + "rimraf": "^2.6.3" }, - "dependencies": {}, "devDependencies": { "eslint": "^4.19.1", "eslint-plugin-mocha": "^5.0.0", diff --git a/test/file-sync-test.js b/test/file-sync-test.js index 52689c5..2c063ed 100644 --- a/test/file-sync-test.js +++ b/test/file-sync-test.js @@ -44,6 +44,10 @@ describe('tmp', function () { }); describe('when running issue specific inband tests', function () { + it('on issue #182: should not replace empty postfix with ".tmp"', function () { + const tmpobj = tmp.fileSync({ postfix: '' }); + assert.ok(!tmpobj.name.endsWith('.tmp')); + }); }); describe('when running standard outband tests', function () { diff --git a/test/file-test.js b/test/file-test.js index 3660a22..494696b 100644 --- a/test/file-test.js +++ b/test/file-test.js @@ -54,6 +54,16 @@ describe('tmp', function () { }); describe('when running issue specific inband tests', function () { + it('on issue #182: should not replace empty postfix with ".tmp"', function (done) { + tmp.file({ postfix: '' }, function (err, path) { + try { + assert.ok(!path.endsWith('.tmp')); + } catch (err) { + return done(err); + } + done(); + }); + }); }); describe('when running standard outband tests', function () {