add obtainDistributedTableName

Signed-off-by: wuchunbo <wuchunbo1@huawei.com>
This commit is contained in:
wuchunbo
2022-02-22 22:24:00 +08:00
parent 416aceb53f
commit 62590fa5d8
+12 -16
View File
@@ -368,6 +368,18 @@ export function mockRdb() {
})
}
},
obtainDistributedTableName: function (...args) {
console.warn("RdbStore.obtainDistributedTableName 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);
} else {
return new Promise((resolve, reject) => {
resolve();
})
}
},
sync: function (...args) {
console.warn("RdbStore.sync interface mocked in the Previewer. How this interface works on the" +
" Previewer may be different from that on a real device.")
@@ -383,26 +395,10 @@ export function mockRdb() {
on: function (...args) {
console.warn("RdbStore.on 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);
} else {
return new Promise((resolve, reject) => {
resolve();
})
}
},
off: function (...args) {
console.warn("RdbStore.off 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);
} else {
return new Promise((resolve, reject) => {
resolve();
})
}
},
};