!495 add batchInsert mock interface

Merge pull request !495 from wangxiyue/master
This commit is contained in:
openharmony_ci 2022-08-02 01:28:13 +00:00 committed by Gitee
commit 1e6285e2ae
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -210,7 +210,7 @@ export function mockRdb() {
SYNC_MODE_PUSH: 0,
SYNC_MODE_PULL: 1
}
const SubscribeType = {
SUBSCRIBE_TYPE_REMOTE: 0
}
@ -227,6 +227,18 @@ export function mockRdb() {
resolve(paramMock.paramNumberMock);
})
}
},
batchInsert: function (...args) {
console.warn("RdbStore.batchInsert 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 (len > 0 && typeof args[len - 1] === 'function') {
args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock);
} else {
return new Promise((resolve, reject) => {
resolve(paramMock.paramNumberMock);
})
}
},
update: function (...args) {
console.warn("RdbStore.update interface mocked in the Previewer. How this interface works on the" +