-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
i18n(ja): add a new guide file testing.mdx
#13140
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
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応ありがとうございます!何点か自分が気になった箇所にコメントしました。すべてを自分の書いた通りに対応する必要もないので、妥当そうなものがあればピックアップして反映してみてください🙏
| @@ -0,0 +1,411 @@ | |||
| --- | |||
| title: テスト | |||
| description: Astroにおけるテストの紹介 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちょっと細かいですが「紹介」よりは「入門」の方がこの場合は適切な気がしますね:
| description: Astroにおけるテストの紹介 | |
| description: Astroにおけるテスト入門 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よりストレートでシンプルにAstroでのテスト入門に変更しました。
|
|
||
| テストは、動作するAstroコードを書き、メンテナンスするのに役立ちます。Astroは、Jest、Mocha、Jasmine、[Cypress](https://cypress.io)、[Playwright](https://playwright.dev)など、ユニットテスト、コンポーネントテスト、E2Eテストのための多くの人気ツールをサポートしています。また、React Testing Libraryのようなフレームワーク固有のテストライブラリをインストールして、UIフレームワークコンポーネントをテストすることもできます。 | ||
|
|
||
| テストフレームワークを使うと、特定の状況においてコードがどのように動作すべきかについての**アサーション**や**エクスペクテーション**を記述し、それを実際のコードの動作と比較できます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これも人それぞれ感ありますが、「アサーション」は割と日本語でも言ったり書いたりすると思うのですが、「エクスペクテーション」はあまり言わない気がしたので、「期待」や「期待値」などの方がいいかもしれません:
| テストフレームワークを使うと、特定の状況においてコードがどのように動作すべきかについての**アサーション**や**エクスペクテーション**を記述し、それを実際のコードの動作と比較できます。 | |
| テストフレームワークを使うと、特定の状況においてコードがどのように動作すべきかについての**アサーション**や**期待値**を記述し、それを実際のコードの動作と比較できます。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここは自分も迷ったですが、個人的に期待値が耳馴染みがあるので、
エクスペクテーション→期待値に変更させていただきました!
|
|
||
| <p><Since v="4.9.0" /></p> | ||
|
|
||
| [container API](/ja/reference/container-reference/)を使用して、Astroコンポーネントをネイティブにテストできます。まず、[上記の説明に従って`vitest`](#vitest)をセットアップし、コンポーネントをテストするための`.test.js`ファイルを作成します: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文頭であるということと機能名であるということから「container API」の先頭は大文字の方が良さそうです:
| [container API](/ja/reference/container-reference/)を使用して、Astroコンポーネントをネイティブにテストできます。まず、[上記の説明に従って`vitest`](#vitest)をセットアップし、コンポーネントをテストするための`.test.js`ファイルを作成します: | |
| [Container API](/ja/reference/container-reference/)を使用して、Astroコンポーネントをネイティブにテストできます。まず、[上記の説明に従って`vitest`](#vitest)をセットアップし、コンポーネントをテストするための`.test.js`ファイルを作成します: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応させていただきました!
|
|
||
| #### Cypressテストを実行する | ||
|
|
||
| Cypressはコマンドラインまたはcypressアプリから実行できます。アプリはテストの実行とデバッグのためのビジュアルインターフェースを提供します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらも大文字の方が良さそうです:
| Cypressはコマンドラインまたはcypressアプリから実行できます。アプリはテストの実行とデバッグのためのビジュアルインターフェースを提供します。 | |
| CypressはコマンドラインまたはCypressアプリから実行できます。アプリはテストの実行とデバッグのためのビジュアルインターフェースを提供します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応させていただきました!
|
|
||
| Cypressはコマンドラインまたはcypressアプリから実行できます。アプリはテストの実行とデバッグのためのビジュアルインターフェースを提供します。 | ||
|
|
||
| まず、Cypressがライブサイトにアクセスできるように開発サーバーを起動します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「ライブサイト」はあまり日本語として聞き馴染みがない気がしたため、「動作中のサイト」などのように変えてもいいかもしれません:
| まず、Cypressがライブサイトにアクセスできるように開発サーバーを起動します。 | |
| まず、Cypressが動作中のサイトにアクセスできるように開発サーバーを起動します。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応させていただきました!
|
|
||
| Cypressアプリが起動したら、**E2E Testing**を選択し、テストの実行に使用するブラウザを選択します。 | ||
|
|
||
| テストの実行が完了すると、テストが成功したことを確認する緑色のチェックマークが出力に表示されます: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これはかなり細かいのですが「出力に表示され」だと同じことを言っているように見えるため、単に「出力されます」とかでよさそうです:
| テストの実行が完了すると、テストが成功したことを確認する緑色のチェックマークが出力に表示されます: | |
| テストの実行が完了すると、テストが成功したことを確認する緑色のチェックマークが出力されます: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
対応させていただきました!
|
レビューいただきありがとうございます!大変助かります🙏 |
morinokami
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description (required)
This PR's change is based on the following a file:
Related issues & labels (optional)
I'd appreciate it if you could review this when you have time🫡