summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-watchfile.js
diff options
context:
space:
mode:
authorHelianthus21 <740051540@qq.com>2017-07-16 15:56:25 +0800
committerJames M Snell <jasnell@gmail.com>2017-07-19 13:06:43 -0700
commit6a587ad043052dce2862cdf3c0a7375545368d87 (patch)
tree0b07a9e669f6a8a1cc0ed8317185148543465d9a /test/parallel/test-fs-watchfile.js
parentc53db1e8e9bb65779d791046daa39ed88c8f1045 (diff)
downloadandroid-node-v8-6a587ad043052dce2862cdf3c0a7375545368d87.tar.gz
android-node-v8-6a587ad043052dce2862cdf3c0a7375545368d87.tar.bz2
android-node-v8-6a587ad043052dce2862cdf3c0a7375545368d87.zip
test: replace string concat in test-fs-watchfile.js
PR-URL: https://github.com/nodejs/node/pull/14287 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-watchfile.js')
-rw-r--r--test/parallel/test-fs-watchfile.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js
index 35ac9b88e1..ca37073368 100644
--- a/test/parallel/test-fs-watchfile.js
+++ b/test/parallel/test-fs-watchfile.js
@@ -67,7 +67,7 @@ fs.watchFile(enoentFile, {interval: 0}, common.mustCall(function(curr, prev) {
// Watch events should callback with a filename on supported systems.
// Omitting AIX. It works but not reliably.
if (common.isLinux || common.isOSX || common.isWindows) {
- const dir = common.tmpDir + '/watch';
+ const dir = path.join(common.tmpDir, 'watch');
fs.mkdir(dir, common.mustCall(function(err) {
if (err) assert.fail(err);
@@ -79,7 +79,7 @@ if (common.isLinux || common.isOSX || common.isWindows) {
}));
const interval = setInterval(() => {
- fs.writeFile(`${dir}/foo.txt`, 'foo', common.mustCall(function(err) {
+ fs.writeFile(path.join(dir, 'foo.txt'), 'foo', common.mustCall((err) => {
if (err) assert.fail(err);
}));
}, 1);