oak-db/test/Context.ts

36 lines
1.1 KiB
TypeScript

import { AsyncContext } from 'oak-domain/lib/store/AsyncRowStore';
import { EntityDict } from './test-app-domain';
import { OakException } from 'oak-domain/lib/types';
export class TestContext extends AsyncContext<EntityDict> {
tryDeduceException(err: Error): Promise<OakException<any> | void> {
throw new Error('Method not implemented.');
}
protected getSerializedData(): Promise<object> {
throw new Error('Method not implemented.');
}
initialize(data: any): Promise<void> {
throw new Error('Method not implemented.');
}
openRootMode(): () => void {
return () => undefined;
}
async refineOpRecords(): Promise<void> {
return;
}
isRoot(): boolean {
return true;
}
setCurrentUserId(userId: string | undefined): void {
throw new Error('Method not implemented.');
}
getCurrentUserId(allowUnloggedIn?: boolean | undefined): string | undefined {
return 'test-root-id';
}
async toString(): Promise<string> {
return '';
}
allowUserUpdate(): boolean {
return true;
}
}