diff options
author | isaacs <i@izs.me> | 2012-09-17 15:45:37 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-09-17 15:49:07 -0700 |
commit | 15101163377a3baa26f97db15735d794daa9cd4d (patch) | |
tree | f32815e041f45f3589c2bdf6a4f8340613899610 | |
parent | b788c5e77b564183826a4ccb69ec9a43a758a54a (diff) | |
download | node-new-15101163377a3baa26f97db15735d794daa9cd4d.tar.gz |
test: fs.watch filename support on Darwin
-rw-r--r-- | test/simple/test-fs-watch.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/simple/test-fs-watch.js b/test/simple/test-fs-watch.js index 2ad05f2e11..88c3359124 100644 --- a/test/simple/test-fs-watch.js +++ b/test/simple/test-fs-watch.js @@ -24,7 +24,9 @@ var assert = require('assert'); var path = require('path'); var fs = require('fs'); -var expectFilePath = process.platform == 'win32' || process.platform == 'linux'; +var expectFilePath = process.platform === 'win32' || + process.platform === 'linux' || + process.platform === 'darwin'; var watchSeenOne = 0; var watchSeenTwo = 0; @@ -63,7 +65,10 @@ assert.doesNotThrow( var watcher = fs.watch(filepathOne) watcher.on('change', function(event, filename) { assert.equal('change', event); - if (expectFilePath) { + + // darwin only shows the file path for subdir watching, + // not for individual file watching. + if (expectFilePath && process.platform !== 'darwin') { assert.equal('watch.txt', filename); } else { assert.equal(null, filename); @@ -87,7 +92,10 @@ assert.doesNotThrow( function() { var watcher = fs.watch(filepathTwo, function(event, filename) { assert.equal('change', event); - if (expectFilePath) { + + // darwin only shows the file path for subdir watching, + // not for individual file watching. + if (expectFilePath && process.platform !== 'darwin') { assert.equal('hasOwnProperty', filename); } else { assert.equal(null, filename); |