0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/parallel/test-file-read-noexist.js
Jenna Vuong a7970c0a25 test: refactor test-file-*
* var to const
* add check that expected error is ENOENT
* indexOf() to includes()

PR-URL: https://github.com/nodejs/node/pull/8999
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2016-10-13 15:10:54 -07:00

12 lines
350 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const filename = path.join(common.fixturesDir, 'does_not_exist.txt');
fs.readFile(filename, 'latin1', common.mustCall(function(err, content) {
assert.ok(err);
assert.strictEqual(err.code, 'ENOENT');
}));