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

Jest add flexibility #7748

Merged
merged 8 commits into from Aug 14, 2019
Merged

Jest add flexibility #7748

merged 8 commits into from Aug 14, 2019

Conversation

CodeByAlex
Copy link
Member

@CodeByAlex CodeByAlex commented Aug 12, 2019

What I did

Refactored the Jest code a bit from being an MVP to a more sustainable codebase. Built-in flexibility for adding new types of test status' that will help @fabiradi work on his bugfix/feature outlined here: #7740.
Sorted values coming into the status bar so that it will order the parts from smallest to largest
slightly improved performance by using fewer loops in render function

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@vercel
Copy link

vercel bot commented Aug 12, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

…st-add-flexibility

# Conflicts:
#	addons/jest/src/components/Panel.tsx
@vercel vercel bot temporarily deployed to staging August 12, 2019 22:21 Inactive
const testsByType: Map<string, any> = new Map();
result.assertionResults.forEach((assertion: any) => {
// using switch to allow for new types to be added
switch (assertion.status) {
Copy link
Member

Choose a reason for hiding this comment

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

why not just use assertion.status instead of switch because the logic is the same in each branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh my goodness, nice find. I could definitely use assertion.status instead. No need for the switch at all

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM with possible exception of duplicate logic!

@shilman
Copy link
Member

shilman commented Aug 13, 2019

Also, what's the bug?

@CodeByAlex CodeByAlex added maintenance User-facing maintenance tasks and removed bug labels Aug 13, 2019
@CodeByAlex
Copy link
Member Author

@shilman switched it to maintenance. Do you think it would fall under that category?

@shilman
Copy link
Member

shilman commented Aug 13, 2019

@CodeByAlex that was my thought 👍

@CodeByAlex CodeByAlex merged commit 120f54d into next Aug 14, 2019
@stof stof deleted the jest-add-flexibility branch October 4, 2019 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: jest maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants