mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-30 12:01:57 +00:00
move client from separate repo
This commit is contained in:
committed by
Aiden McClelland
parent
d2f542a8f3
commit
9ad59a4d1a
17
client/tests/mocks/http.mock.ts
Normal file
17
client/tests/mocks/http.mock.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Http } from '../../lib/patch-db'
|
||||
import { Revision, Dump } from '../../lib/sequence-store'
|
||||
|
||||
export class MockHttp<T> implements Http<T> {
|
||||
constructor (private readonly mockData: {
|
||||
getSequences: Revision[],
|
||||
getDump: Dump<T>
|
||||
}) { }
|
||||
|
||||
getRevisions (): Promise<Revision[]> {
|
||||
return Promise.resolve(this.mockData.getSequences)
|
||||
}
|
||||
|
||||
getDump (): Promise<Dump<T>> {
|
||||
return Promise.resolve(this.mockData.getDump)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user