Skip to content

Commit 84cea56

Browse files
authored
Merge pull request #184 from raszi/gh-182
test: add missing tests for #182
2 parents 150ab4e + 5591fdf commit 84cea56

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
"node": ">=6"
2323
},
2424
"dependencies": {
25-
"rimraf": "^2.6.2"
25+
"rimraf": "^2.6.3"
2626
},
27-
"dependencies": {},
2827
"devDependencies": {
2928
"eslint": "^4.19.1",
3029
"eslint-plugin-mocha": "^5.0.0",

test/file-sync-test.js

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ describe('tmp', function () {
4444
});
4545

4646
describe('when running issue specific inband tests', function () {
47+
it('on issue #182: should not replace empty postfix with ".tmp"', function () {
48+
const tmpobj = tmp.fileSync({ postfix: '' });
49+
assert.ok(!tmpobj.name.endsWith('.tmp'));
50+
});
4751
});
4852

4953
describe('when running standard outband tests', function () {

test/file-test.js

+10
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ describe('tmp', function () {
5454
});
5555

5656
describe('when running issue specific inband tests', function () {
57+
it('on issue #182: should not replace empty postfix with ".tmp"', function (done) {
58+
tmp.file({ postfix: '' }, function (err, path) {
59+
try {
60+
assert.ok(!path.endsWith('.tmp'));
61+
} catch (err) {
62+
return done(err);
63+
}
64+
done();
65+
});
66+
});
5767
});
5868

5969
describe('when running standard outband tests', function () {

0 commit comments

Comments
 (0)