MCPcopy
hub / github.com/di-sukharev/opencommit / TestAi

Class TestAi

src/engine/testAi.ts:16–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14};
15
16export class TestAi implements TestAiEngine {
17 mockType: TestMockType;
18
19 // those are not used in the test engine
20 config: any;
21 client: any;
22 // ---
23
24 constructor(mockType: TestMockType) {
25 this.mockType = mockType;
26 }
27
28 async generateCommitMessage(
29 _messages: Array<OpenAI.Chat.Completions.ChatCompletionMessageParam>
30 ): Promise<string | undefined> {
31 switch (this.mockType) {
32 case 'commit-message':
33 return 'fix(testAi.ts): test commit message';
34 case 'prompt-module-commitlint-config':
35 return (
36 `{\n` +
37 ` "localLanguage": "english",\n` +
38 ` "commitFix": "fix(server): Change 'port' variable to uppercase 'PORT'",\n` +
39 ` "commitFeat": "feat(server): Allow server to listen on a port specified through environment variable",\n` +
40 ` "commitDescription": "Change 'port' variable to uppercase 'PORT'. Allow server to listen on a port specified through environment variable."\n` +
41 `}`
42 );
43 default:
44 throw Error('unsupported test mock type');
45 }
46 }
47}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…