Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] test: 音声書き出しe2eテスト #2473

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

Hiroshiba
Copy link
Member

@Hiroshiba Hiroshiba commented Jan 4, 2025

内容

エンジンモックを使った音声書き出しのテストを書いてみます。
まだ途中なのでWIPです。

その他

ブラウザ内でのファイル書き込みをどうモックするかで悩みました。
最終的にbackendのwriteFileをDI(というよりもmock?)することで解決しました。

他の方法としてブラウザに標準的についてるFileHandleあたりを差し替えることもできるんですが、↓の用にいろいろ問題があったのでやめました。

  • PlaywrightはshowOpenFilePickerなどのファイル選択ダイアログをmockできない
  • showOpenFilePickerをDIして適当なFileHandlerを返すこともできるけど、FileHandler周りのテストをPlaywrightがサポートしていない
  • ブラウザ版backendのFileHandler周りの実装に直で依存してしまう
    • まだブラウザ版のファイル管理アーキテクチャが成熟しきったあとなら依存しても良さそう

@Hiroshiba Hiroshiba requested a review from a team as a code owner January 4, 2025 15:24
@Hiroshiba Hiroshiba marked this pull request as draft January 4, 2025 15:25
@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Jan 18, 2025

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:5587acb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant