node/test/known_issues/test-fs-cp-async-buffer.js
James M Snell 2022f832a9
test: add known issue tests for fs.cp
PR-URL: https://github.com/nodejs/node/pull/58883
Refs: https://github.com/nodejs/node/issues/58634
Refs: https://github.com/nodejs/node/issues/58869
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-07-01 04:35:06 +00:00

23 lines
700 B
JavaScript

'use strict';
// We expect this test to fail because the implementation of fsPromise.cp
// does not properly support the use of Buffer as the source or destination
// argument like fs.cpSync does.
// Refs: https://github.com/nodejs/node/issues/58634
// Refs: https://github.com/nodejs/node/issues/58869
const common = require('../common');
const { mkdirSync, promises } = require('fs');
const { join } = require('path');
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
const tmpA = join(tmpdir.path, 'a');
const tmpB = join(tmpdir.path, 'b');
mkdirSync(tmpA, { recursive: true });
promises.cp(Buffer.from(tmpA), Buffer.from(tmpB), {
recursive: true,
}).then(common.mustCall());