summaryrefslogtreecommitdiff
path: root/test/parallel/test-file-read-noexist.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-file-read-noexist.js')
-rw-r--r--test/parallel/test-file-read-noexist.js18
1 files changed, 3 insertions, 15 deletions
diff --git a/test/parallel/test-file-read-noexist.js b/test/parallel/test-file-read-noexist.js
index 3673b701b5..166beea0f8 100644
--- a/test/parallel/test-file-read-noexist.js
+++ b/test/parallel/test-file-read-noexist.js
@@ -3,20 +3,8 @@ var common = require('../common');
var assert = require('assert');
var path = require('path');
var fs = require('fs');
-var got_error = false;
var filename = path.join(common.fixturesDir, 'does_not_exist.txt');
-fs.readFile(filename, 'latin1', function(err, content) {
- if (err) {
- got_error = true;
- } else {
- console.error('cat returned some content: ' + content);
- console.error('this shouldn\'t happen as the file doesn\'t exist...');
- assert.equal(true, false);
- }
-});
-
-process.on('exit', function() {
- console.log('done');
- assert.equal(true, got_error);
-});
+fs.readFile(filename, 'latin1', common.mustCall(function(err, content) {
+ assert.ok(err);
+}));