From afcd30649d9cfbc75755329965362914896869e0 Mon Sep 17 00:00:00 2001 From: Kingsword Date: Wed, 25 Jun 2025 14:21:43 +0800 Subject: [PATCH] fix(bindings/nodejs): ListOptions test list with deleted --- bindings/nodejs/tests/suites/asyncListOptions.suite.mjs | 7 ++++--- bindings/nodejs/tests/suites/syncListOptions.suite.mjs | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bindings/nodejs/tests/suites/asyncListOptions.suite.mjs b/bindings/nodejs/tests/suites/asyncListOptions.suite.mjs index 51be72543a8d..6ae2a5d67ded 100644 --- a/bindings/nodejs/tests/suites/asyncListOptions.suite.mjs +++ b/bindings/nodejs/tests/suites/asyncListOptions.suite.mjs @@ -158,13 +158,14 @@ export function run(op) { const filePath = path.join(dirname, `random_file_${randomUUID()}`) await op.write(filePath, '1') - const lists = await op.list(dirname, { deleted: true }) + const lists = await op.list(filePath, { deleted: true }) expect(lists.length).toBe(1) await op.write(filePath, '2') - await op.remove(filePath) + await op.delete(filePath) - const actual = lists.filter((item) => item.path() === filePath && item.metadata().isDeleted()) + const ds = await op.list(filePath, { deleted: true }) + const actual = ds.filter((item) => item.path() === filePath && item.metadata().isDeleted()) expect(actual.length).toBe(1) await op.removeAll(dirname) diff --git a/bindings/nodejs/tests/suites/syncListOptions.suite.mjs b/bindings/nodejs/tests/suites/syncListOptions.suite.mjs index 49eaef4dfe1e..6be9d19c7c32 100644 --- a/bindings/nodejs/tests/suites/syncListOptions.suite.mjs +++ b/bindings/nodejs/tests/suites/syncListOptions.suite.mjs @@ -158,13 +158,14 @@ export function run(op) { const filePath = path.join(dirname, `random_file_${randomUUID()}`) op.writeSync(filePath, '1') - const lists = op.listSync(dirname, { deleted: true }) + const lists = op.listSync(filePath, { deleted: true }) expect(lists.length).toBe(1) op.writeSync(filePath, '2') - op.removeSync(filePath) + op.deleteSync(filePath) - const actual = lists.filter((item) => item.path() === filePath && item.metadata().isDeleted()) + const ds = op.listSync(filePath, { deleted: true }) + const actual = ds.filter((item) => item.path() === filePath && item.metadata().isDeleted()) expect(actual.length).toBe(1) op.removeAllSync(dirname)