Coverage is not working with 'cypress' in project path

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

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

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

評価

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

調査の方向性

リンク先の angular-library-cypress プロジェクトで、cypress を含むパスから npm run cypress-project-run を実行して問題を再現し、その後、名前を変更したパスからもう一度実行します。まず README の Debugging セクションと、.nyc_output/out.json を作成または検索するコードを確認します。プロジェクトパスの名前に関係なくカバレッジが機能すれば完了です。

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

説明

Logs and screenshots
Please provide debug logs by running Cypress from the terminal with DEBUG=code-coverage environment variable set. See the Debugging section of the README file.

Exception in output that coverage could not be found

2023-11-12 12:03:29: webpack compiled in 8669 ms (c571cd78cb7c28bd)


  NgButtonComponent
Cannot find coverage file C:\Daten\jNetwork\angular-library-cypress\.nyc_output\out.json
Skipping coverage report
    √ should click (375ms)

Versions

  • What is this plugin's version? If this is NOT the latest released version, can you try the latest version, please?

3.12.9

  • If the plugin worked before in version X but stopped after upgrading to version Y, please try the released versions between X and Y to see where the breaking change was.

no

  • What is the Cypress version?

13.5.0

  • What is your operating system?

Windows 10

  • What is the shell? -

windows cmd

  • What is the Node version?

v16.15.1

  • What is the NPM version?

8.12.2

see in my example projcet

  • When running tests, if you open the web application in a regular browser and open DevTools, do you see window.__coverage__ object? Can you paste a screenshot?

problem can be reproduced with my example project

  • Is there a .nyc_output folder? Is there a .nyc_output/out.json file? Is it empty? Can you paste at least part of it so we can see the keys and file paths?

no. folder is not written

  • Do you have any custom NYC settings in package.json (nyc object) or in other NYC config files?

no

  • Do you run Cypress tests in a Docker container?

no

Describe the bug

If the name Cypress is present in the project path, Code Coverage does not work. The output Cannot find coverage file C:\Data\jNetwork\angular-library-cypress\.nyc_output\out.json appears in the console. If you rename the path from angular-library-cypress to angular-library-cy as in the example here, everything works correctly.

You can reproduce the problem with the project https://github.com/philippjenni/angular-library-cypress. Check out the project in the angular-library-cypress folder and execute npm run cypress-project-run. Code coverage will not work. Check out the same project in a folder without the word cypress and execute npm run cypress-project-run. The coverage report is written correctly.

Link to the repo

https://github.com/philippjenni/angular-library-cypress

主要言語
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 を短くまとめたダイジェスト。