fix(tests): Add extensive provider/feature tests and local Claude CI permissions
This commit is contained in:
36
test/test.audio.stubs.ts
Normal file
36
test/test.audio.stubs.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as qenv from '@push.rocks/qenv';
|
||||
|
||||
const testQenv = new qenv.Qenv('./', './.nogit/');
|
||||
|
||||
import * as smartai from '../ts/index.js';
|
||||
|
||||
let anthropicProvider: smartai.AnthropicProvider;
|
||||
|
||||
tap.test('Audio Stubs: should create Anthropic provider', async () => {
|
||||
anthropicProvider = new smartai.AnthropicProvider({
|
||||
anthropicToken: await testQenv.getEnvVarOnDemand('ANTHROPIC_TOKEN'),
|
||||
});
|
||||
await anthropicProvider.start();
|
||||
});
|
||||
|
||||
tap.test('Audio Stubs: Anthropic audio should throw not supported error', async () => {
|
||||
let errorCaught = false;
|
||||
|
||||
try {
|
||||
await anthropicProvider.audio({
|
||||
message: 'This should fail'
|
||||
});
|
||||
} catch (error) {
|
||||
errorCaught = true;
|
||||
expect(error.message).toInclude('not yet supported');
|
||||
}
|
||||
|
||||
expect(errorCaught).toBeTrue();
|
||||
});
|
||||
|
||||
tap.test('Audio Stubs: should stop Anthropic provider', async () => {
|
||||
await anthropicProvider.stop();
|
||||
});
|
||||
|
||||
export default tap.start();
|
Reference in New Issue
Block a user