!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

@ -228,6 +228,18 @@ export function mockRdb() {
})
}
},
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" +
" Previewer may be different from that on a real device.")