From e4c6942aed07f7e6f6efc4509fda46aba7afb255 Mon Sep 17 00:00:00 2001 From: zhangxingxia Date: Tue, 19 Jul 2022 14:45:41 +0800 Subject: [PATCH] update mock Signed-off-by: zhangxingxia --- runtime/main/extend/systemplugin/napi/ohos_fileManager.js | 8 ++++---- .../main/extend/systemplugin/napi/ohos_volumeManager.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/main/extend/systemplugin/napi/ohos_fileManager.js b/runtime/main/extend/systemplugin/napi/ohos_fileManager.js index 6491bda7..d9fc9eb9 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_fileManager.js +++ b/runtime/main/extend/systemplugin/napi/ohos_fileManager.js @@ -35,10 +35,10 @@ export function mockFileManager() { " Previewer may be different from that on a real device.") const len = args.length if (typeof args[len - 1] === 'function') { - args[len - 1].call(this, paramMock.businessErrorMock, Array(FileInfo)) + args[len - 1].call(this, paramMock.businessErrorMock, new Array(FileInfo)) } else { return new Promise((resolve, reject) => { - resolve(Array(FileInfo)); + resolve(new Array(FileInfo)); }) } }, @@ -47,10 +47,10 @@ export function mockFileManager() { " Previewer may be different from that on a real device.") const len = args.length if (typeof args[len - 1] === 'function') { - args[len - 1].call(this, paramMock.businessErrorMock, Array(FileInfo)) + args[len - 1].call(this, paramMock.businessErrorMock, new Array(FileInfo)) } else { return new Promise((resolve, reject) => { - resolve(Array(FileInfo)); + resolve(new Array(FileInfo)); }) } }, diff --git a/runtime/main/extend/systemplugin/napi/ohos_volumeManager.js b/runtime/main/extend/systemplugin/napi/ohos_volumeManager.js index 412dda53..4854b912 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_volumeManager.js +++ b/runtime/main/extend/systemplugin/napi/ohos_volumeManager.js @@ -31,10 +31,10 @@ export function mockVolumeManager() { " Previewer may be different from that on a real device."); const len = args.length; if (typeof args[len - 1] === 'function') { - args[len - 1].call(this, paramMock.businessErrorMock, Array(Volume)); + args[len - 1].call(this, paramMock.businessErrorMock, new Array(Volume)); } else { return new Promise((resolve, reject) => { - resolve(Array(Volume)); + resolve(new Array(Volume)); }) } },