update mock

Signed-off-by: zhangxingxia <zhangxingxia1@huawei.com>
This commit is contained in:
zhangxingxia
2022-07-19 14:45:41 +08:00
parent 5c4f8c9c3b
commit e4c6942aed
2 changed files with 6 additions and 6 deletions
@@ -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));
})
}
},
@@ -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));
})
}
},