Rename and/or replace `coverage:report` script

オープン
#545 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cypress, typescript
領域
testing

調査の方向性

まず package.json の coverage:report エントリと、cypress.json および .nycrc に記載されている Cypress のカバレッジ設定を確認します。要求された範囲が Cypress 固有の名前変更なのか、cypress.json における設定可能な nyc オプションなのかを判断します。完了条件は、誤解を招く汎用的なスクリプト名を使わずに Cypress のカバレッジを設定可能な状態に保つことです。

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.
Currently, if you want to have different nyc options for your Cypress tests (for example if you're using a different test runner for unit tests), the only way to pass custom options is to use the coverage:report script in package.json. This approach is problematic because it's essentially a magic script name—new developers coming on to a project would have no indication what this script is for. What's worse, because it's in package.json, you can't even add a code comment to explain it. Your only option is to add something to a README or other documentation and hope that people actually read it.

Describe the solution you'd like
The ideal solution would be to make this command (as well as nyc options in general) configurable in cypress.json instead of relying on a magic script.

But at the very least, I feel the script should be renamed to something that makes it clear that this is related to Cypress, such as cypress:coverage:report. The current name is completely generic, and sounds like it should be used by the developer for generating generalized coverage reports.

Describe alternatives you've considered
In theory one workaround for this situation is to simply set the desired nyc config in the project's global .nycrc and instead pass a custom config for the other (i.e., unit) test runner. But this is still problematic because it would still not be immediately obvious that the global .nycrc config is actually specific to Cypress (again, one cannot add comments to it because of the JSON format).

Additional context
Just to reiterate, this is chiefly for a scenario where a different nyc config is desired for different test runners.

主要言語
TypeScript
スター
440
フォーク
114
平均マージ
42分
マージ済み PR(30日)
19

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cypress-io/code-coverage のほかの issue

cypress-io/code-coverage の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。