import {RunResult, SqlType, Statement, TypedDatabase} from "../../types"; import * as sqlite3 from "sqlite3"; export async function init(): Promise { } export class MockDatabase implements TypedDatabase { constructor() { } async on(event: string, listener: any): Promise { } async run(sql: SqlType, ...params: any[]): Promise { return { stmt: new Statement(new sqlite3.Statement()), }; } async get(sql: SqlType, ...params: any[]): Promise { return undefined; } async each(sql: SqlType, callback: (err: any, row: T) => void): Promise; async each(sql: SqlType, param1: any, callback: (err: any, row: T) => void): Promise; async each(sql: SqlType, param1: any, param2: any, callback: (err: any, row: T) => void): Promise; async each(sql: SqlType, param1: any, param2: any, param3: any, callback: (err: any, row: T) => void): Promise; async each(sql: SqlType, ...params: any[]): Promise; async each(sql: SqlType, ...callback: (any)[]): Promise { return 0; } async all(sql: SqlType, ...params: any[]): Promise { return []; } async exec(sql: SqlType, ...params: any[]): Promise { } async prepare(sql: SqlType, ...params: any[]): Promise { return new Statement(new sqlite3.Statement()); } } export const db: MockDatabase = new MockDatabase(); export {TypedDatabase, Statement}