Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 1 addition & 1 deletion lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ async function stat(path, options = { bigint: false }) {

async function statfs(path, options = { bigint: false }) {
const result = await PromisePrototypeThen(
binding.statfs(path, options.bigint, kUsePromises),
binding.statfs(getValidatedPath(path), options.bigint, kUsePromises),
undefined,
handleErrorFromBinding,
);
Expand Down
15 changes: 15 additions & 0 deletions test/parallel/test-fs-promises-statfs-validate-path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

const common = require('../common');
const fs = require('fs');
const assert = require('assert');

(async () => {
await assert.rejects(
fs.promises.statfs(),
(err) => {
assert.strictEqual(err.code, 'ERR_INVALID_ARG_TYPE');
return true;
}
);
})().then(common.mustCall());
Loading