0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-file-read-noexist.js
Rich Trott 44efd66132 test: replace deprecated util.debug() calls
common.debug() is just util.debug() and emits a deprecation notice. Per
docs, use console.error() instead.

PR-URL: https://github.com/nodejs/node/pull/3082
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-09-28 11:15:06 -07:00

23 lines
595 B
JavaScript

'use strict';
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, 'binary', 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);
});