mirror of https://github.com/nodejs/node.git
test: file read no exist update to test runner
This commit is contained in:
parent
6f12f1e500
commit
e98a900c59
|
@ -20,13 +20,19 @@
|
|||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
const fixtures = require('../common/fixtures');
|
||||
require('../common');
|
||||
const assert = require('assert');
|
||||
const fixtures = require('../common/fixtures');
|
||||
const fs = require('fs');
|
||||
const { describe, it } = require('node:test');
|
||||
|
||||
const filename = fixtures.path('does_not_exist.txt');
|
||||
fs.readFile(filename, 'latin1', common.mustCall(function(err, content) {
|
||||
assert.ok(err);
|
||||
assert.strictEqual(err.code, 'ENOENT');
|
||||
}));
|
||||
describe('fs.readfile', () => {
|
||||
it('should return ENOENT error code for non existing file', (_, done) => {
|
||||
const filename = fixtures.path('does_not_exist.txt');
|
||||
fs.readFile(filename, 'latin1', function(err, _) {
|
||||
assert.ok(err);
|
||||
assert.strictEqual(err.code, 'ENOENT');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue