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

Docgen: split getIntermediateRepresentation unit tests in smaller tests #31468

Merged
merged 10 commits into from
May 6, 2021
Merged

Docgen: split getIntermediateRepresentation unit tests in smaller tests #31468

merged 10 commits into from
May 6, 2021

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented May 4, 2021

Description

The getIntermediateRepresentation unit tests currently have a lot of assertions per test, making them hard to read and debug in case of failure.
This PR aims at splitting the assertion into smaller tests.

The actual code for the tests hasn't been updated. The main changes are:

  • Add one intermediate level of describe around most tests
  • Split long tests into smaller ones

Most of the diff changes are caused by the change in indentation.

How has this been tested?

  • Run npm run test-unit packages/docgen
  • Make sure that all tests are passing
  • Check how the list of tests for getIntermediateRepresentation is more granular

Screenshots

N/A

Types of changes

Refactor

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • (N/A) I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@ciampo ciampo requested a review from oandregal as a code owner May 4, 2021 15:39
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label May 4, 2021
@github-actions
Copy link

github-actions bot commented May 4, 2021

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @ciampo! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@ntsekouras ntsekouras added [Type] Code Quality Issues or PRs that relate to code quality [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. labels May 6, 2021
Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @ciampo 👍 !

@ntsekouras ntsekouras merged commit 7944946 into WordPress:trunk May 6, 2021
@github-actions github-actions bot added this to the Gutenberg 10.7 milestone May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants