mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2026-02-09 16:41:32 +01:00
- Add tests for AI debug logging functionality - Verify debug logs appear when ZSH_AUTOSUGGEST_AI_DEBUG=1 - Verify debug logs hidden when debug mode disabled This spec ensures the AI strategy properly logs diagnostic information when debug mode is enabled, helping users troubleshoot API key issues and other AI-related problems. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
25 lines
702 B
Ruby
25 lines
702 B
Ruby
describe 'the `ai` strategy debug logging' do
|
|
let(:options) { ["ZSH_AUTOSUGGEST_STRATEGY=(ai)"] }
|
|
|
|
context 'when debug is enabled' do
|
|
let(:options) do
|
|
[
|
|
"ZSH_AUTOSUGGEST_STRATEGY=(ai)",
|
|
"ZSH_AUTOSUGGEST_AI_DEBUG=1"
|
|
]
|
|
end
|
|
|
|
it 'logs why AI suggestion is skipped when API key is missing' do
|
|
session.send_string('brew')
|
|
wait_for { session.content }.to match(/\[zsh-autosuggestions ai\] API key not set/)
|
|
end
|
|
end
|
|
|
|
context 'when debug is disabled by default' do
|
|
it 'does not print AI debug logs' do
|
|
session.send_string('brew')
|
|
sleep 0.2
|
|
expect(session.content).not_to match(/\[zsh-autosuggestions ai\]/)
|
|
end
|
|
end
|
|
end
|