-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stub database as control group in case needed.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
]; | ||
} | ||
} |