Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-03-14 01:59:42 +0400
committerisaacs <i@izs.me>2013-03-14 02:34:18 +0400
commit6bd8b7e5405e1cdc9f56214f5f6b741806c32e5f (patch)
tree6722c868e6469202d0ae1d798b4315c98c43ebfe /test
parentfa05e8a2706e20a191942fe2b2273481605a1f14 (diff)
fs: Missing cb errors are deprecated, not a throw
Commit a804347 makes fs function rethrow errors when the callback is omitted. While the right thing to do, it's a change from the old v0.8 behavior where such errors were silently ignored. To give users time to upgrade, temporarily disable that and replace it with a function that warns once about the deprecated behavior. Close #5005
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-fs-readfile-error.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/simple/test-fs-readfile-error.js b/test/simple/test-fs-readfile-error.js
index 72e1e2e7fb7..97d2f06a611 100644
--- a/test/simple/test-fs-readfile-error.js
+++ b/test/simple/test-fs-readfile-error.js
@@ -28,7 +28,7 @@ var callbacks = 0;
function test(env, cb) {
var filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js');
- var execPath = process.execPath + ' ' + filename;
+ var execPath = process.execPath + ' --throw-deprecation ' + filename;
var options = { env: env || {} };
exec(execPath, options, function(err, stdout, stderr) {
assert(err);
@@ -53,3 +53,12 @@ test({ NODE_DEBUG: 'fs' }, function(data) {
process.on('exit', function() {
assert.equal(callbacks, 2);
});
+
+(function() {
+ console.error('the warnings are normal here.');
+ // just make sure that this doesn't crash the process.
+ var fs = require('fs');
+ fs.readFile(__dirname);
+ fs.readdir(__filename);
+ fs.unlink('gee-i-sure-hope-this-file-isnt-important-or-existing');
+})();