Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: replace fs/promises methods with fs/promises filehandle methods
Replacing fs/promises methods read and write with  fs/promises
filehandle methods.
  • Loading branch information
shisama committed Jun 10, 2018
commit 4c72ba1ed6608afb0bdca7aad231fef8343242a7
6 changes: 3 additions & 3 deletions test/parallel/test-fs-promises-file-handle-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');
const fixtures = require('../common/fixtures');
const tmpdir = require('../common/tmpdir');

const { access, copyFile, open, read, write } = require('fs/promises');
const { access, copyFile, open } = require('fs/promises');
const path = require('path');

common.crashOnUnhandledRejection();
Expand All @@ -18,8 +18,8 @@ async function validateSync() {
await handle.datasync();
await handle.sync();
const buf = Buffer.from('hello world');
await write(handle, buf);
const ret = await read(handle, Buffer.alloc(11), 0, 11, 0);
await handle.write(buf);
const ret = await handle.read(Buffer.alloc(11), 0, 11, 0);
assert.strictEqual(ret.bytesRead, 11);
assert.deepStrictEqual(ret.buffer, buf);
}
Expand Down