test: unlink temp file at test start

The file has a long name that's apparently impossible to remove with
`git clean` on Windows.
pull/24507/merge
Ben Noordhuis 2013-03-02 02:43:01 +01:00
parent d1b4dcd6ac
commit 93156a6057
1 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,13 @@ var fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x'));
var fullPath = path.resolve(fileName);
try {
fs.unlinkSync(fullPath);
}
catch (e) {
// Ignore.
}
console.log({
filenameLength: fileName.length,
fullPathLength: fullPath.length