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

chore: fix local jest run #3218

Merged
merged 14 commits into from
Sep 24, 2024
Merged

Conversation

HendrikThePendric
Copy link
Contributor

@HendrikThePendric HendrikThePendric commented Sep 23, 2024

This PR is not related to a JIRA issue, but the fact that it's currently impossible to run tests locally is highly problematic when trying to debug test failures after making changes in the codebase.


Key features

  1. Get the tests to run locally by disabling the report-portal config locally
  2. Prevent console.errors from showing up in the test output (FYI these errors are not making the tests fail, but are making the test output hard to interpret)

Description

The current state of the PR is captured in the TODO list


TODO

  • Disable report portal config locally
  • Prevent component import errors (Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.). Not 100% sure how to fix this. I did end up finding a good fix for this in the end
  • Prevent axis is not iterable error (Error: Uncaught [TypeError: axis is not iterable (cannot read property undefined)]. This is caused by convertOuLevelsToUids which is imported from @dhis2/analytics and is ultimately coming from layoutGetAllDimensions, which doesn't handle axis being undefined. Not sure if the correct fix is to adjust the test data or the implementation in @dhis2/analytics

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Sep 23, 2024

🚀 Deployed on https://pr-3218.data-visualizer.netlify.dhis2.org

@dhis2-bot dhis2-bot temporarily deployed to netlify September 23, 2024 09:17 Inactive
@HendrikThePendric HendrikThePendric changed the title Chore/fix-local-jest-test-run chore: fix local jest run Sep 23, 2024
@dhis2-bot dhis2-bot temporarily deployed to netlify September 23, 2024 14:48 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify September 23, 2024 15:35 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify September 24, 2024 07:07 Inactive
@HendrikThePendric HendrikThePendric marked this pull request as ready for review September 24, 2024 07:28
@dhis2-bot dhis2-bot temporarily deployed to netlify September 24, 2024 07:28 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify September 24, 2024 08:20 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify September 24, 2024 08:36 Inactive
@HendrikThePendric HendrikThePendric added the e2e record Apply this label to a pull request to trigger recording of E2E tests on Cypress Cloud label Sep 24, 2024
@HendrikThePendric HendrikThePendric merged commit 7d89fc2 into master Sep 24, 2024
35 of 46 checks passed
@HendrikThePendric HendrikThePendric deleted the chore/fix-local-jest-test-run branch September 24, 2024 10:12
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.7.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e record Apply this label to a pull request to trigger recording of E2E tests on Cypress Cloud released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants