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

Testing JavaScript: Necessary changes in testing module of javascript #28560

Merged
merged 7 commits into from
Aug 4, 2024
6 changes: 2 additions & 4 deletions javascript/testing_javascript/more_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@ There are two solutions to the 'tightly coupled code' problem. The first, and b

<div class="lesson-content__panel" markdown="1">

1. If you haven’t already, watch [FunFunFunction's "Mocking Basics" video](https://www.youtube.com/watch?v=3PjdxjWK0F0).
1. Watch this [video about mocks in testing](https://www.youtube.com/watch?v=ajiAl5UNzBU&t=3024s).
1. Too much mocking can be a bad thing. It *is* sometimes necessary, but if you have to set up an elaborate system of mocks to test any bit of your code, that means your code is too tightly coupled. While it is quite in-depth, the following article contains several really good points about [program architecture and testing](https://medium.com/javascript-scene/mocking-is-a-code-smell-944a70c90a6a).
1. Now that you have some practice and context for TDD, the [Jest docs section on "Setup and Teardown"](https://jestjs.io/docs/setup-teardown) will probably make good sense to you.
1. Read about [Jest's really handy mocking functions](https://jestjs.io/docs/mock-functions).
1. Watch this amazing video that covers [what to test in your codebase](https://www.youtube.com/watch?v=URSWYvyc42M).

The video is specifically about testing the Ruby language, but that doesn't matter *at all*. The concepts here ring true in any language, and luckily Ruby is a clear enough language that you will be able to follow along just fine.
1. Watch this amazing video that covers [what to test in your codebase](https://www.youtube.com/watch?v=URSWYvyc42M). The video is specifically about testing the Ruby language, but that doesn't matter *at all*. The concepts here ring true in any language, and luckily Ruby is a clear enough language that you will be able to follow along just fine.

</div>

Expand Down
2 changes: 1 addition & 1 deletion javascript/testing_javascript/testing_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This section contains a general overview of topics that you will learn in this l
<div class="lesson-content__panel" markdown="1">

1. Read about the [basic process and the benefits of TDD](https://web.archive.org/web/20211123190134/http://godswillokwara.com/index.php/2016/09/09/the-importance-of-test-driven-development/).
1. Watch at least the first 3 videos of [the Unit Testing in JavaScript video series](https://www.youtube.com/playlist?list=PL0zVEGEvSaeF_zoW9o66wa_UCNE3a7BEr). The first video focuses heavily on the WHY, while the next two go into more depth about the process. We will cover the rest of the videos in our [More Testing](https://www.theodinproject.com/lessons/node-path-javascript-more-testing) lesson.
1. Watch at least the first 3 videos of [the Unit Testing in JavaScript video series](https://www.youtube.com/playlist?list=PL0zVEGEvSaeF_zoW9o66wa_UCNE3a7BEr).
1. Follow along to [Jest's Getting Started tutorial](https://jestjs.io/docs/getting-started). For the upcoming testing practice and project, you only need to follow the instructions for installing jest.
1. Read and follow the [Using Matchers](https://jestjs.io/docs/using-matchers) document on the main Jest website. This one demonstrates some of the other useful functions you can use in your tests.
1. This article explains more about [the why/how and value behind TDD](https://jrsinclair.com/articles/2016/one-weird-trick-that-will-change-the-way-you-code-forever-javascript-tdd/) and also includes some great examples of how to apply it.
Expand Down