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

Bug - test-utils.js needs updated when loading .nycrc.yaml files #680

Open
tommyc38 opened this issue Aug 11, 2023 · 1 comment
Open

Bug - test-utils.js needs updated when loading .nycrc.yaml files #680

tommyc38 opened this issue Aug 11, 2023 · 1 comment

Comments

@tommyc38
Copy link

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.

Screenshot 2023-08-11 at 8 55 51 AM

Versions

  • What is this plugin's version? If this is NOT the latest released version can you try the latest version, please?
  • 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.
  • What is Cypress version? "cypress": "^12.17.3",
  • What is your operating system?
    I tried this locally (latest MacOS) as well as in my ci docker container with the same result:
    cypress/browsers:node16.16.0-chrome107-ff107-edge
    https://github.com/cypress-io/cypress-docker-images/tree/master/included - link to cypress/node images
    image: cypress/included:12.3.0
  • What is the shell? bash
  • What is the Node version? 16.16.0
  • What is the NPM version?
  • How do you instrument your application? Cypress does not instrument web application code, so you need to do it yourself. I do this with webpack config and confirm it works.
  • When running tests, if you open the web application in regular browser, and open DevTools, do you see window.__coverage__ object? Can you paste a screenshot?
  • Is there .nyc_output folder? Is there .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?
  • Do you have any custom NYC settings in package.json (nyc object) or in other NYC config files. Yes, I use a .nycrc.yaml file.
  • Do you run Cypress tests in a Docker container? Yes, see above info on the docker image for my ci.

Describe the bug
My .nycrc.yaml file is blowing up cypress e2e tests. I have monkey patched test-utils.js to swap out yaml.safeLoad with yaml.load and everything works.

Link to the repo
Bugs with a reproducible example, like an open source repo showing the bug, are the most likely to be resolved.

Example
See #217 that is an excellent bug report example

@Sinetheta
Copy link

An alternative to a monkey-patch is to override the dependency

  "overrides": {
    "@cypress/code-coverage": {
      "js-yaml": "<4.0"
    }
  },

looks like the bump was made by a bot and code-coverage still works fine without it #371

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

No branches or pull requests

2 participants