Factor out common code for markup in React plugins#4171
Factor out common code for markup in React plugins#4171cpojer merged 6 commits intojestjs:masterfrom
Conversation
|
Needs prettier! |
| config: Config, | ||
| indentation: string, | ||
| ): string => { | ||
| const tag = config.colors.tag; |
There was a problem hiding this comment.
I replaced it with tagColor but am happy to change to colorTag if that is clearer
| getChildren(item, children); | ||
| }); | ||
| } else if (arg != null && arg !== false) { | ||
| children.push(arg); |
There was a problem hiding this comment.
I like the simplification of this callback 👍
Codecov Report
@@ Coverage Diff @@
## master #4171 +/- ##
=========================================
- Coverage 60.55% 60.4% -0.15%
=========================================
Files 196 197 +1
Lines 6776 6751 -25
Branches 6 6
=========================================
- Hits 4103 4078 -25
Misses 2670 2670
Partials 3 3
Continue to review full report at Codecov.
|
|
This race was too close to call, which is as you might expect:
|
|
Super sweet cleanup. |
* Factor out common code for markup in React plugins * Add mistakenly deleted export * Put getType after getChildren to improve diff * Make the 2 new tests parallel * Fix pretty lint error * Replace tag with tagColor
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Enforce consistency, reduce code. Like the TV advert: looks pretty, less filling :)
We will probably be able to factor out common code in HTMLElement too.
Analogy to react-redux as you review this diff:
Test plan
Added 2 tests to prevent regression related to test object for subset match, especially because of the incorrect Flow error.