Repository navigation
TTS関数でStandard音声以外を既定値へフォールバックする - #5657
Merged
Merged
Conversation
Contributor
📝 WalkthroughウォークスルーTTS音声名の解決ロジックを専用のユーティリティ関数に抽出しました。新しい 変更内容
推定レビュー工数🎯 2 (Simple) | ⏱️ ~10 分 ポエム
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
functions/src/utils/ttsVoice.test.ts (1)
6-43: エッジケースのテスト追加を検討してください。現在のテストは主要なシナリオをカバーしていますが、
resolveStandardVoiceNameの堅牢性を確認するために、以下のエッジケースの追加を推奨します:
- 空文字列
''の入力- 空白のみ
' 'の入力nullやundefinedの入力🧪 追加テスト例
+ it('handles empty and whitespace-only inputs', () => { + expect( + resolveStandardVoiceName('', '', 'en-US-Standard-G') + ).toBe('en-US-Standard-G'); + expect( + resolveStandardVoiceName(' ', ' ', 'en-US-Standard-G') + ).toBe('en-US-Standard-G'); + }); + + it('handles null and undefined inputs', () => { + expect( + resolveStandardVoiceName(null, undefined, 'en-US-Standard-G') + ).toBe('en-US-Standard-G'); + });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@functions/src/utils/ttsVoice.test.ts` around lines 6 - 43, Add tests for resolveStandardVoiceName and isStandardVoiceName covering empty string, whitespace-only, null, and undefined inputs; specifically, assert that isStandardVoiceName returns false for '' and ' ' and that resolveStandardVoiceName treats '' / ' ' / null / undefined as invalid requests (falling back to the configured standard voice parameter or ultimately to the provided defaultStandardVoice), and include cases where requestedVoice is null/undefined and configuredVoice is valid, and where both are null/invalid to confirm defaultStandardVoice is returned. Ensure you add new it blocks in the ttsVoice test suite referencing isStandardVoiceName and resolveStandardVoiceName so behavior for these edge cases is verified.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@functions/src/utils/ttsVoice.test.ts`:
- Around line 6-43: Add tests for resolveStandardVoiceName and
isStandardVoiceName covering empty string, whitespace-only, null, and undefined
inputs; specifically, assert that isStandardVoiceName returns false for '' and '
' and that resolveStandardVoiceName treats '' / ' ' / null / undefined as
invalid requests (falling back to the configured standard voice parameter or
ultimately to the provided defaultStandardVoice), and include cases where
requestedVoice is null/undefined and configuredVoice is valid, and where both
are null/invalid to confirm defaultStandardVoice is returned. Ensure you add new
it blocks in the ttsVoice test suite referencing isStandardVoiceName and
resolveStandardVoiceName so behavior for these edge cases is verified.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ebda0078-3c10-4db8-8f25-2e915a5879d9
📒 Files selected for processing (3)
functions/src/funcs/tts.tsfunctions/src/utils/ttsVoice.test.tsfunctions/src/utils/ttsVoice.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
リスク
確認
Summary by CodeRabbit
リリースノート
Refactor
Tests