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

fix: safer read of DEBUG_PRINT_LIMIT #1329

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

sieem
Copy link
Contributor

@sieem sieem commented Jul 15, 2024

What:

We encountered some issues on our CI. We use Azure DevOps with this image: using docker/cypress/browsers:node-20.14.0-chrome-126.0.6478.114-1-ff-127.0.1-edge-126.0.2592.61-1. This was the log produces when a test failed (for a different reason):

  2) (Site Management) Manage capacity
       Permissions
         Should show the page when user has correct permissions:
     AssertionError: Timed out retrying after 4000ms: Cannot read properties of undefined (reading 'DEBUG_PRINT_LIMIT')
      at Context.eval (webpack:///./src/ui/support/page-permissions.helper.ts:25:0)

Apparently process was defined, while process.env was not. I don't see the harm to do this extra check.

Why:
To have proper error logging when a test fails.

How:
I first used patch-package to patch this library on our codebase with the same change. This unblocked our ci and gave us proper logging of this failing test.

I ran the tests after my changes on this repo and no tests were failing.

Checklist:

  • Documentation added to the
    docs site N/A
  • Tests
  • TypeScript definitions updated N/A
  • Ready to be merged

Copy link

codesandbox-ci bot commented Jul 15, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0171d61:

Sandbox Source
react-testing-library-examples Configuration

Copy link
Member

@MatanBobi MatanBobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

@MatanBobi MatanBobi merged commit 306526b into testing-library:main Jul 15, 2024
4 checks passed
@MatanBobi
Copy link
Member

@all-contributors please add @sieem for code :)

Copy link
Contributor

@MatanBobi

I've put up a pull request to add @sieem! 🎉

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

Successfully merging this pull request may close these issues.

2 participants