test: ✅ add the first E2E test and configuration to CI (#316)
* add tests
This commit is contained in:
committed by
GitHub
parent
bdc98c6fa8
commit
5cda8b1b03
@@ -27,7 +27,7 @@ let apiKey = config?.OCO_OPENAI_API_KEY
|
||||
|
||||
const [command, mode] = process.argv.slice(2);
|
||||
|
||||
const isLocalModel = config?.OCO_AI_PROVIDER == 'ollama'
|
||||
const isLocalModel = config?.OCO_AI_PROVIDER == 'ollama' || config?.OCO_AI_PROVIDER == 'test';
|
||||
|
||||
|
||||
if (!apiKey && command !== 'config' && mode !== CONFIG_MODES.set && !isLocalModel) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ChatCompletionRequestMessage } from 'openai';
|
||||
import { AiEngine } from './Engine';
|
||||
|
||||
export class TestAi implements AiEngine {
|
||||
async generateCommitMessage(
|
||||
messages: Array<ChatCompletionRequestMessage>
|
||||
): Promise<string | undefined> {
|
||||
return 'test commit message';
|
||||
}
|
||||
}
|
||||
|
||||
export const testAi = new TestAi();
|
||||
Reference in New Issue
Block a user