summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-append-file.js
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2017-02-28 16:13:49 +0200
committerNikolai Vavilov <vvnicholas@gmail.com>2017-06-10 20:34:50 +0300
commit208db5675ebfcf1decdb106f217a4d4ebf17aa17 (patch)
treed3b67df5d693fdd790117b8af599b2c392947800 /test/parallel/test-fs-append-file.js
parentdf02f391aaea20edcefb840312184f266632949b (diff)
downloadandroid-node-v8-208db5675ebfcf1decdb106f217a4d4ebf17aa17.tar.gz
android-node-v8-208db5675ebfcf1decdb106f217a4d4ebf17aa17.tar.bz2
android-node-v8-208db5675ebfcf1decdb106f217a4d4ebf17aa17.zip
fs: don't conflate data and callback in appendFile
PR-URL: https://github.com/nodejs/node/pull/11607 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-append-file.js')
-rw-r--r--test/parallel/test-fs-append-file.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/parallel/test-fs-append-file.js b/test/parallel/test-fs-append-file.js
index 025a0ed034..e3e4c273d3 100644
--- a/test/parallel/test-fs-append-file.js
+++ b/test/parallel/test-fs-append-file.js
@@ -144,6 +144,13 @@ fs.open(filename5, 'a+', function(e, fd) {
});
});
+// test that a missing callback emits a warning, even if the last argument is a
+// function.
+const filename6 = join(common.tmpDir, 'append6.txt');
+const warn = 'Calling an asynchronous function without callback is deprecated.';
+common.expectWarning('DeprecationWarning', warn);
+fs.appendFile(filename6, console.log);
+
process.on('exit', function() {
assert.strictEqual(12, ncallbacks);