Makelore 2.0 initial clean snapshot
This commit is contained in:
17
tests/unit/opencode-error-kind.test.ts
Normal file
17
tests/unit/opencode-error-kind.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { getOpencodeErrorKind } from '../../shared/opencode-error-kind';
|
||||
|
||||
describe('getOpencodeErrorKind', () => {
|
||||
it('classifies a generic Works Square gateway authorization failure as invalid authentication', () => {
|
||||
expect(getOpencodeErrorKind('works_square_gateway_authorize_failed')).toBe('authentication_invalid');
|
||||
});
|
||||
|
||||
it.each([
|
||||
'token_balance_exhausted',
|
||||
'Token balance exhausted',
|
||||
'Token quota exhausted for rolling 5-hour window',
|
||||
'works_square_gateway_authorize_failed: Token balance exhausted',
|
||||
])('classifies explicit quota evidence as exhausted: %s', (message) => {
|
||||
expect(getOpencodeErrorKind(message)).toBe('quota_exhausted');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user