node8: we can safely use os.tmpdir()

Since we are requiring node >= 8, we can safely use native functionalities.
This commit is contained in:
muxator 2019-02-15 22:30:17 +01:00 committed by muxator
parent 09949c242a
commit 6d36bb2c53
3 changed files with 4 additions and 10 deletions

View file

@ -23,7 +23,8 @@ describe('tidyHtml', function() {
}
// Try to tidy up a bad HTML file
var tmpDir = process.env.TEMP || "/tmp";
const tmpDir = os.tmpdir();
var tmpFile = path.join(tmpDir, 'tmp_' + (Math.floor(Math.random() * 1000000)) + '.html')
fs.writeFileSync(tmpFile, '<html><body><p>a paragraph</p><li>List without outer UL</li>trailing closing p</p></body></html>');
TidyHtml.tidy(tmpFile, function(err){