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

dependency: Replace jsonlint with json-parse-even-better-errors #29673

Merged
merged 21 commits into from
Jul 13, 2024

Conversation

jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Jun 13, 2024

Additional details

This replaces jsonlint (which hasn't been updated in 6 years) with a more maintained package to provide json linting, json-parse-even-better-errors.

Steps to test

Existing tests have been updated, but you can run a test locally to see the error:

fixtures/bad.json

{
  "bad": "json"
  "should": "not parse"
}

test.cy.js

it('throws error on bad json', () => {
  cy.visit('index.html')
  cy.fixture('bad.json')
})

How has the user experience changed?

This does change the user experience. The json linting errors are formatted differently. It's not as good imo, but it does provide enough information to debug the issue properly. These errors only display when someone calls cy.fixture() on a JSON file that is not proper JSON, so the instances of people seeing these errors seems pretty low.

Before

Screenshot 2024-06-13 at 12 41 35 PM

After

Screenshot 2024-06-13 at 12 17 28 PM

PR Tasks

@jennifer-shehane jennifer-shehane self-assigned this Jun 13, 2024
Copy link

cypress bot commented Jun 13, 2024

7 flaky tests on run #56128 ↗︎

0 29292 1328 0 Flakiness 7

Details:

Merge branch 'develop' into remove-json-lint
Project: cypress Commit: 99b18a2c74
Status: Passed Duration: 22:36 💡
Started: Jul 12, 2024 9:13 PM Ended: Jul 12, 2024 9:35 PM
Flakiness  e2e/origin/cookie_login.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
... > past Max-Age, before Expires -> not logged in
    </td>
  </tr></table>
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output

Test Artifacts
network stubbing > waiting and aliasing > can spy on a 304 not modified image response
    </td>
  </tr></table>
Flakiness  commands/waiting.cy.js • 1 flaky test • 5x-driver-chrome

View Output

Test Artifacts
... > errors > throws when waiting for 2nd response to route Test Replay
Flakiness  commands/files.cy.js • 1 flaky test • 5x-driver-electron

View Output

Test Artifacts
... > passes through assertion error when not about existence Test Replay
Flakiness  commands/files.cy.js • 1 flaky test • 5x-driver-chrome:beta

View Output

Test Artifacts
... > passes through assertion error when not about existence Test Replay

The first 5 flaky specs are shown, see all 6 specs in Cypress Cloud.

Review all test suite changes for PR #29673 ↗︎

@jennifer-shehane jennifer-shehane removed the request for review from ryanthemanuel July 12, 2024 13:40
@jennifer-shehane jennifer-shehane merged commit 4755bd9 into develop Jul 13, 2024
114 of 118 checks passed
@jennifer-shehane jennifer-shehane deleted the remove-json-lint branch July 13, 2024 02:53
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 16, 2024

Released in 13.13.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.13.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CVE-2021-23358 found on trivy scan cypress version is 13.3.3
4 participants