From 5710fffb120eba88e1b261e3ef379cb02575de42 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sat, 25 Nov 2023 11:35:36 +0900 Subject: chore: update node_compat test suites to v18.18.2 (#21328) --- cli/tests/node_compat/test/common/tmpdir.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cli/tests/node_compat/test/common/tmpdir.js') diff --git a/cli/tests/node_compat/test/common/tmpdir.js b/cli/tests/node_compat/test/common/tmpdir.js index 2c97c51a6..886c4a107 100644 --- a/cli/tests/node_compat/test/common/tmpdir.js +++ b/cli/tests/node_compat/test/common/tmpdir.js @@ -62,7 +62,18 @@ function onexit() { } } +function resolve(...paths) { + return path.resolve(tmpPath, ...paths); +} + +function hasEnoughSpace(size) { + const { bavail, bsize } = fs.statfsSync(tmpPath); + return bavail >= Math.ceil(size / bsize); +} + module.exports = { path: tmpPath, - refresh + refresh, + hasEnoughSpace, + resolve, }; -- cgit v1.2.3