Skip to content

Commit

Permalink
Add stub database as control group in case needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kj415j45 committed Aug 9, 2023
1 parent 76e64b5 commit 571d129
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/StubDatabase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { TestData } from "./TestData";
import { TestDatabase } from "./TestDatabase";

export class StubDatabase extends TestDatabase {
name(): string {
return "Stub";
}

async connect(uri?: string | undefined): Promise<void> {}
async disconnect(): Promise<void> {}
async cleanup(): Promise<void> {}
async create(data: TestData[]): Promise<void> {}
async prepare(): Promise<void> {}
async usageReport(): Promise<object> {
return {};
}

async queryA(lng: number, lat: number): Promise<TestData> {
return {
id: "stub",
lng,
lat,
};
}

async queryB(
lng: number,
lat: number,
maxDistance: number
): Promise<TestData[]> {
return [
{
id: "stub",
lng,
lat,
},
];
}

async queryC(
lng: number,
lat: number,
maxDistance: number
): Promise<TestData[]> {
return [
{
id: "stub",
lng,
lat,
},
];
}
}

0 comments on commit 571d129

Please sign in to comment.