mirror of
https://gitee.com/openharmony/third_party_jsframework
synced 2024-11-23 06:40:59 +00:00
add mock of distributedData
Signed-off-by: dboy190 <dulei1@huawei.com>
This commit is contained in:
parent
9934af24a1
commit
89f71f1ead
@ -465,6 +465,45 @@ export function mockDistributedData() {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
this.backup = function (...args) {
|
||||
console.warn("KVStore.backup interface mocked in the Previewer. How this interface works" +
|
||||
" on the 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)
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
this.restore = function (...args) {
|
||||
console.warn("KVStore.restore interface mocked in the Previewer. How this interface works" +
|
||||
" on the 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)
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
this.deleteBackup = function (...args) {
|
||||
console.warn("KVStore.deleteBackup interface mocked in the Previewer. How this interface works" +
|
||||
" on the 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)
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
resolve()
|
||||
})
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user