<p dir="auto">I made tests a bit too verbose in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="275857315" data-permission-text="Title is private" data-url="https://github.com/facebook/react/issues/11616" data-hovercard-type="pull_request" data-hovercard-url="/facebook/react/pull/11616/hovercard" href="https://github.com/facebook/react/pull/11616">#11616</a>.<br>
Might be a good time to revisit how we write them now.</p>
<p dir="auto">There's a few separate issues:</p>
<ul dir="auto">
<li>
<p dir="auto">Asserting on warning messages is too verbose. Need a DEV block, call <code class="notranslate">spyOnDev</code>, normalize stack, etc. Ideally I wish there was a higher level helper that lets us "push" expected warning assertions and validate them as they happen. It should handle component stacks automatically without having to copy-paste the normalization helper everywhere.</p>
</li>
<li>
<p dir="auto">In some cases I added actual duplication in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="275857315" data-permission-text="Title is private" data-url="https://github.com/facebook/react/issues/11616" data-hovercard-type="pull_request" data-hovercard-url="/facebook/react/pull/11616/hovercard" href="https://github.com/facebook/react/pull/11616">#11616</a>, in particular for cases that throw in development but don't throw in production. Maybe need a <code class="notranslate">toThrowInDev()</code>? Although on the other hand this pattern needs to be highly visible so maybe extracting common code in a closure is good enough.</p>
</li>
</ul>
<p dir="auto">Conditional Rendering Components JSX-Control-Statement produces incorrect coverage in if / else branches. We are using it in our project and we want official Facebook's opinion about these as whether it will be updated with babel's AST for future support. If not please warn the developers that they will get incorrect branch coverage. See the reported issue below.<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="314235072" data-permission-text="Title is private" data-url="https://github.com/istanbuljs/nyc/issues/812" data-hovercard-type="issue" data-hovercard-url="/istanbuljs/nyc/issues/812/hovercard" href="https://github.com/istanbuljs/nyc/issues/812">istanbuljs/nyc#812</a></p>
<ol dir="auto">
<li>Will facebook support any approach similar to JSX-Control-Statements in the future?</li>
<li>If facebook does not support any approach like above, facebook should warn it's developers about using such library due to incorrect coverages.</li>
<li>Issue consistent in jest and nyc since they both use babel's AST.</li>
</ol>
<p dir="auto"><a href="https://github.com/AlexGilleran/jsx-control-statements">https://github.com/AlexGilleran/jsx-control-statements</a></p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Feature(?)<br>
<strong>What is the current behavior?</strong><br>
Incorrect Coverage</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Correct Coverage Report on custom conditional rendered components.</p>