Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
test: don't create temp files in fixtures dir
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Dec 31, 2011
1 parent 8b2abed commit 539598b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/simple/test-fs-watch.js
Expand Up @@ -30,8 +30,7 @@ var watchSeenOne = 0;
var watchSeenTwo = 0;
var watchSeenThree = 0;

var startDir = process.cwd();
var testDir = common.fixturesDir;
var testDir = common.tmpDir;

var filenameOne = 'watch.txt';
var filepathOne = path.join(testDir, filenameOne);
Expand All @@ -46,15 +45,16 @@ var filepathThree = path.join(testsubdir, filenameThree);


process.on('exit', function() {
fs.unlinkSync(filepathOne);
fs.unlinkSync(filepathTwoAbs);
fs.unlinkSync(filepathThree);
fs.rmdirSync(testsubdir);
assert.ok(watchSeenOne > 0);
assert.ok(watchSeenTwo > 0);
assert.ok(watchSeenThree > 0);
});

// Clean up stale files (if any) from previous run.
try { fs.unlinkSync(filepathOne); } catch (e) { }
try { fs.unlinkSync(filepathTwoAbs); } catch (e) { }
try { fs.unlinkSync(filepathThree); } catch (e) { }
try { fs.rmdirSync(testsubdir); } catch (e) { }

fs.writeFileSync(filepathOne, 'hello');

Expand Down

0 comments on commit 539598b

Please sign in to comment.