hookshot/tests/utils/AppserviceMock.ts
Will Hunt 9b216afd2b
Fix GitHub/GitLab state config not being honoured (#346)
* 1.6.1

* Add new error type for validation errors

* Validate state for GitHubRepo properly

* Add tests to check labels

* Also check GitLab repo

* changelog

* add mock store

* remove nullable

* Be less strict for existing state

* Improve test coverage

* Improve expect error text

* ValidationApiError now takes falsey objects and errors on them

* Remove UserTokenMockStore

* Actually commit the new tests

* Whoops we need to include github
2022-05-12 11:28:55 +01:00

22 lines
479 B
TypeScript

import { IntentMock } from "./IntentMock";
export class AppserviceMock {
public readonly botIntent = IntentMock.create();
static create(){
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return new this() as any;
}
get botUserId() {
return `@bot:example.com`;
}
get botClient() {
return this.botIntent.underlyingClient;
}
public getIntentForUserId() {
return IntentMock.create();
}
}