Kent C. Dodds - Testing JavaScript

Kent C. Dodds - Testing JavaScript

Register & Get access to index
KKlT5XT.png



Learn a smart and efficient way to test any JavaScript application. Why test your JavaScript? Every time a bug is discovered, your app's user experience is bursting at the seams. Bugs are bad. Who will be blamed? You, the developer! Before each deployment, your code must be tested to ensure full working functionality. Professionals write code that works, and I mean code that is tested.


There is only one problem ...

"Testing takes too much time and effort."


You don't have time, you are already busy.

There is no obvious ROI. You cannot calculate the income from testing.

It is impossible to test everything. Most tests are clicks, clicks, clicks on every move of your application. It seems like a waste of time when it's better spent on new features than QA. But one way or another, your application will be verified. If not you, then your users.

Cross your fingers and pour on prod.

If we want to deliver high quality, well tested JavaScript applications, we must have a better way.

Imagine you outsource your application testing.

You are a developer.

You know that people are bad at difficult, repetitive tasks.

You also know that computers are very, very good at complex, repetitive tasks.

Professional developers use computers to automate testing of critical paths, behaviors, and all the little things - over and over, all day and all night.

This is how professional developers do everything they do ... and that's great.

Automated tests are promotion.

Automated tests are your backup, your muscle.

Automatic tests are your secret weapon ...


But before you can build these tests, you need to know:

  • What should you test?
  • When to test it?
  • Do you need 100% coverage?
  • How many tests are enough?
You can scour the internet to find the right alchemy of testing tools and methods - or you can skip the paralysis of analysis and go for success with a proven testing method.

Four-level proven software testing method

Using this proven testing method, you will use these methods:

  • Use the static type system and linter to capture basic errors like typos and syntax.
  • Write effective unit tests that target the critical behavior and functionality of your application.
  • Design integration tests to comprehensively audit your application and make sure everything is working correctly in harmony.
  • Create end-to-end (e2e) functional tests to automatically click-test critical paths instead of relying on your users.
These four levels of automated testing give you a template for delivering professional JavaScript applications with confidence, speed, and money. Everytime.

One professional test method for every JavaScript application

This course will apply a four-tiered testing method to a React application, but this foundational strategy can be applied to any JavaScript environment: Angular, Vue , legacy Backbone applications, even frameworks and libraries that we haven't met yet.

After this course, you will:

  • provide robust features that work for users as expected
  • choose the best tools for the job
  • communicate more effectively with colleagues
  • a more confident, professional JavaScript developer
Learn a professional JavaScript testing method and always deliver high quality software like a professional.

What's in JavaScript testing?

7 modules with solid testing experience

1. JavaScript Testing Basics

Do you know what a testing framework does? Do you know what makes a testing framework different from a testing library? The best way to use a tool effectively is to understand how it works. And the best way to understand how the tool works is to do it yourself!

In this short course, we will learn how frameworks and libraries work by creating our own, simpler version of each.

2. Static Analysis Testing JavaScript Applications

There are many ways your application can break. One of the most common sources of errors is associated with typos and incorrect types. Passing a string to a function that expects a number or ends up in a common typo in a boolean expression are silly mistakes that should never be made, but it happens all the time.

We could write a complete suite of automated tests for our entire codebase so that such bugs never occur, but that would probably be too much work and slow development. Luckily for us, there are tools we can use to cater to a whole category of testing with great developer experience.

3. Basics of JavaScript Mocking

When doing unit tests, you don't want to actually make network requests or charge real credit cards. It can ... get expensive ... So instead of running your code exactly as it will in production, you can change some of your JavaScript modules and functions during tests and improve the speed of your tests.

There are some great libraries and abstractions for mocking your JavaScript modules during your tests. Jest has great capabilities for inline functions as well as entire modules. To really understand how things work, let's implement some of these features ourselves.

4. Configuring Jest for Testing JavaScript Applications

Jest is a fully featured testing framework that is second to none. It is surprisingly simple and flexible at the same time. For simple use cases, you often don't need to configure, install, and use built-in coverage and view support.

However, in a real application, you will often need specific needs for your application, especially when testing browser based applications. You will need to handle Webpack loaders, dynamic imports and custom module resolution, which Node.js does not support.

In this course, we'll look at how you can optimize your Jest configuration to make real-world JavaScript application testing amazing. We'll cover what has already been mentioned in addition to Babel support, code coverage, how to make View mode even more useful, and how to run test suites with completely different configurations.

5. Installing, configuring Cypress for JavaScript web applications

Cypress is an incredibly powerful web testing tool. It is capable of testing any web application. Its architecture places it in a cut above similar end-to-end testing tools. His experience is best in class. And because Cypress runs your tests in the same context as the rest of your application, you can get the speed, reliability, and debuggability that are just a distant dream with similar tools. Trick? no. Cypress is exceptional.

In this course, we'll look at how you can install, configure Cypress to test modern JavaScript web applications in the real world.

6. Test React components with Jest and react-testing-library

If you want to deliver your applications with confidence, you need a great suite of automated tests to absolutely make sure that nothing breaks when the changes reach your users. To gain this confidence, your tests must realistically simulate how users actually use your React components.

In this course, we'll write a series of rendering techniques and run a series of tests to see how we can get the confidence we're looking for without giving up on maintainability or test speed.

7. Use dom-testing library to test any JS framework

The person using your application components need not know or care what frameworks you used to write your application. Guess what: Same as your tests.

This course explores the dom-testing library using 11 different frameworks, from React to Svelte. You will gain practical skills in writing tests for any JavaScript framework.

8. NEW Testing Node.js Backends (lesson 115-154)

The backend contains so much of our application's business logic, which is often used to support multiple clients (web, mobile and other native platforms). This logic is critical to getting it right, and rolling out a revolutionary change can have devastating consequences for your company's goals (not to mention the results). Increasing your “deployment confidence” is critical, and automated testing is the best way to do this.

As Node.js continues to grow in use around the world, it becomes increasingly important to learn how to test this critical code in a way that improves developer speed and confidence. In this workshop, we use the Express.js example and focus on the patterns and techniques you need to learn so that you can apply what you have learned to test your code written in any Node.js web environment.

  • Testing pure functions
  • Middleware testing
  • Testing controllers
  • Testing API routes
  • Mocking third party dependencies
Get feedback from industry experts

Practical tests with wes bos and Scott Tolinski and other renowned developers in the industry.

FAQ

Can modules in a course be updated as software changes?


Yes. I plan to support this course! It ignores "versions" altogether and takes fundamental approaches to testing your applications, but as they change they will be updated here.

Is this course complete?

This course is currently in preview! All video tutorials for each module are available, but some of the bonus materials and downloads are not yet ready.
Author
TUTProfessor
Downloads
1,826
Views
11,711
First release
Last update
Rating
3.86 star(s) 7 ratings

More resources from TUTProfessor

Latest updates

  1. New Update

    Course Updated 12-2022Repack reason: Some of video file corrupted from author side these are...
  2. New Update

    Updated With New Content [12-2020]

Latest reviews

Dead links
Links are not working hopefully it will get fixed soon. after giving access to rclone to google account for get auth the page doesn't open with an error unable to connect can’t establish a connection to the server at 127.0.0.1:53683.
Ahh
Greate course by the way. Thanks
maybe
This resource is from the top javascript teacher out there
awesome course