@electric-sql/drivers
Version:
ElectricSQL database drivers.
23 lines • 535 B
JavaScript
class MockDatabase {
constructor(databaseName, fail) {
this.databaseName = databaseName;
this.fail = fail;
}
getAllAsync(_source, _params) {
return this.resolveIfNotFail([{ i: 0 }]);
}
runAsync(_source, _params) {
return this.resolveIfNotFail({
lastInsertRowId: 0,
changes: 0
});
}
resolveIfNotFail(value) {
if (typeof this.fail !== "undefined") return Promise.reject(this.fail);
else return Promise.resolve(value);
}
}
export {
MockDatabase
};
//# sourceMappingURL=mock.js.map