<ul>n<li>n<p><strong>Unit tests</strong>: Unit tests are atomic. They are within the scope of one component or action or reducer or saga and do not go beyond the scope of this atomic component.</p>n<ul>n<li>Example: Unit tests do not involve <code class="language-text">reducer && saga</code> being tested together or <code class="language-text">component && action && reducer && saga</code> being tested together.</li>n</ul>n</li>n<li>n<p><strong>Integration tests</strong>: Integration tests are an extension of unit tests and involve integrating multiple components.</p>n<ul>n<li>Example: component click on button -> throws an action -> watched by the saga -> calls an api endpoint (mocked) -> modify reducers state -> changes something on the same or another component.</li>n</ul>n</li>n<li><strong>End to end tests</strong>: We use Cypress for end to end testing where we test the end results like how an external user with interact with our system / UI.</li>n</ul>n<h2 id="resources"><a href="#resources" aria-hidden class="anchor"><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Resources</h2>n<ul>n<li>n<blockquote class="twitter-tweet" data-dnt="true"><p lang="en" dir="ltr">🤔 Question for tech folks 🤔<br><br>"How do you differentiate between integration tests and end-to-end tests? They're very similar and I cannot for the life of me define a concrete line where one ends and the other begins."<br><br>Anyone have thoughts or resources on this?</p>— Carolyn Stransky (@carolstran) <a href="https://twitter.com/carolstran/status/1194647777143349248?ref_src=twsrc%5Etfw">November 13, 2019</a></blockquote>nn</li>n<li><a href="https://kentcdodds.com/blog/unit-vs-integration-vs-e2e-tests" target="_blank" rel="nofollow noopener noreferrer">https://kentcdodds.com/blog/unit-vs-integration-vs-e2e-tests</a></li>n</ul>n <div style="margin-top=55px; font-style: italic;">(This is an article posted to my blog at princiya.com/blog. You can read it online by <a href="https://atomic-temporary-42700218.wpcomstaging.com/blog/unit-vs-integration-vs-end-to-end-tests/">clicking here</a>.)</div>
Categorised as: Uncategorized
How to know if you are writing integration tests or end to end tests
1–2 minutes





Leave a comment