Learn the smart, efficient way to test any JavaScript application.

Your essential guide to flawless testing

byKent C. DoddsKent C. Dodds
The Testing Trophy

Why bother testing your JavaScript?

When a user encounters a bug they look like this: 🤬

Bugs grind work to a halt.

Bugs cause financial harm.

Every single time a bug is encountered, user trust erodes.

Bugs are bad.

And who gets blamed?

You.

The developer.

You know you should squash bugs before your code is deployed.

You know you need to ship code that:

  • Takes every opportunity to guarantee that it works.
  • Doesn’t punish users with unnecessary bugs.
  • Doesn’t play whack-a-mole with features, fixing one thing only to break another.
  • Is maintainable and understandable to your co-workers.

A professional ships working code. Code that works.

We’re talking about code that is well tested. Only through testing can you confidently deliver confident, professional code.

Why aren’t you testing code that users rely on?

When code fails on your users, have you failed to do your job?

You should do your job as well as possible and test, right?

Right.

Just one problem...

“Testing takes too much time and effort.”

There’s no time. You’re busy already.

There’s no obvious ROI. You can’t get the buy-in or budget for testing efforts.

There’s no way to test everything. Most testing is click click clicking around every turn of your application. It takes forever and feels like a waste of time—time you want to spend shipping new features, not QAing.

Nobody has time for that. But one way or another, your application will be tested. If not by you, then by your users.

Cross your fingers and push to prod.

So... click click click hope for the best? That’s what we’re doing?

If we want to ship high-quality, well-tested JavaScript applications there has to be a better way.

Imagine outsourcing the heavy lifting of testing your application.

You're a developer.

You know humans are bad at complex, 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 and over again, all day and all night.

That’s how professional developers get things done... and done well.

Automated tests are the pro move.

Automated tests are your backup, your muscle.

Automated tests are your secret weapon...

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

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

    A four-layer proven method for testing software

    The Testing Trophy is a bottom-to-top professional method for testing web applications. It’s about writing just enough tests—the right tests. It’s not about reaching for 100% coverage.

    trophy graphic with four sections to represent the 4 levels of testing: static, unit, integration, and end to end tests

    By using this proven testing method, you’ll layer these techniques:

    • Use a static type system and a linter to capture basic errors like typos and syntax.
    • Write effective unit tests that target the critical behavior and functionality of your application.
    • Develop integration tests to audit your application holistically and make sure everything works together correctly in harmony.
    • Create end-to-end (e2e) functional tests for automated click-testing of critical paths instead of relying on your users to do it for you.

    These four layers of automated testing give you the playbook to ship professional JavaScript applications with confidence, speed, and money savings. Every time.

    One professional method of testing every JavaScript application

    This course will apply the four-layer testing method to a React application, but this foundational strategy can be applied across any JavaScript framework: Angular, Vue, legacy Backbone apps, even frameworks and libraries we haven’t met yet.

    Following this course, you’ll be equipped to:

    • deliver solid features that work for users as expected
    • choose the best tools for the job
    • communicate more effectively with your coworkers
    • be a more confident, professional JavaScript developer

    Learn the professional method for JavaScript testing and always ship high quality software like the professional you are.

    Abstract illustration of code testing

    What's in Testing JavaScript?

    7 modules full of dense testing knowledge

    abstract illustration representing the course

    Install, Configure, and Script Cypress for JavaScript Web Applications

    • lesson icon18 video lessons
    • code iconcode
    • transcript icontranscript
    • duration icon54m of learning material

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

    In this course, we’ll go over how you can install, configure, and script Cypress to test modern, real-world JavaScript web applications.

    abstract illustration representing the course

    Use dom-testing-library to test any JS framework

    • lesson icon11 video lessons
    • code iconcode
    • transcript icontranscript
    • duration icon14m of learning material

    The person using your application components shouldn’t have to know or care what framework(s) you used to write your application. Guess what: Neither should your tests.

    This course explores the dom-testing-library using 11 different frameworks, from React to Svelte. You’ll get hands-on experience writing tests for any JavaScript framework, giving you the confidence you need to ship your JavaScript application with your framework of choice.

    abstract illustration representing the course

    Test React Components with Jest and react-testing-library

    • lesson icon32 video lessons
    • code iconcode
    • transcript icontranscript
    • duration icon1h 34m of learning material

    If you want to ship your applications with confidence—and of course you do—you need an excellent suite of automated tests to make absolutely sure that when changes reach your users, nothing gets broken. To get this confidence, your tests need to realistically mimic how users actually use your React components. Otherwise, tests could pass when the application is broken in the real world.

    In this course, we’ll write a series of render methods and run a range of tests to see how we can get the confidence we’re looking for, without giving up maintainability or test run-speed.

    abstract illustration representing the course

    Configure Jest for Testing JavaScript Applications

    • lesson icon24 video lessons
    • code iconcode
    • transcript icontranscript
    • duration icon1h 28m of learning material

    Jest is a fully featured testing framework with a developer experience that is second to none. It’s remarkably simple and flexible at the same time. For simple use cases, you often don’t need to configure anything, install and enjoy the built-in coverage and watch mode support.

    In a real-world application though, you’ll often have needs specific to your application, especially when testing browser-based applications. You'll need to handle Webpack loaders, dynamic imports, and custom module resolution which Node.js does not support.

    In this course we’ll go over ways you can optimize your Jest configuration to make testing real-world JavaScript applications a delight. We’ll cover what’s already been mentioned in addition to Babel support, code coverage, how to make watch mode even more helpful, and how to run test suites with entirely different configurations.

    abstract illustration representing the course

    JavaScript Mocking Fundamentals

    • lesson icon5 video lessons
    • code iconcode
    • transcript icontranscript
    • duration icon13m of learning material

    When running unit tests, you don’t want to actually make network requests or charge real credit cards. That could… get expensive… and also very, very slow. So instead of running your code exactly as it would run in production, you can modify how some of your JavaScript modules and functions work during tests to avoid test unreliability (flakiness) and improve the speed of your tests. This kind of modification can come in the form of stubs, mocks, or generally: “test doubles.”

    There are some great libraries and abstractions for mocking your JavaScript modules during tests. The Jest testing framework has great mocking capabilities built-in for functions as well as entire modules. To really understand how things are working though, let’s implement some of these features ourselves.

    abstract illustration representing the course

    Static Analysis Testing JavaScript Applications

    • lesson icon8 video lessons
    • code iconcode
    • transcript icontranscript
    • duration icon23m of learning material

    There are a ton of ways your application can break. One of the most common sources of bugs is related to typos and incorrect types. Passing a string to a function that expects a number, or falling prey to a common typo in a logical statement are silly mistakes that should never be made, but this happens all the time.

    We could write a comprehensive suite of automated tests for our entire codebase to make certain mistakes like this never happen, but that would likely be too much work and slow development down to be worth the benefit. Luckily for us, there are tools we can use to satisfy a whole category of testing with a great developer experience.

    abstract illustration representing the course

    Fundamentals of Testing in JavaScript

    • lesson icon6 video lessons
    • code iconcode
    • transcript icontranscript
    • duration icon8m of learning material

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

    In this short course, we’ll learn how testing frameworks and assertion libraries work by building our own, simple version of each.

    Gain insight from industry experts.

    Exclusive Pro Testing Bonus Content

    Interviews

    Wes Bos
    Scott Tolinski

    Practical testing with Wes Bos and Scott Tolinski

    Wes is a full stack web developer and designer from Hamilton, Canada. He loves to share what he knows through his training products, teaching and speaking at conferences.

    Scott Tolinski is the creator of Level Up Tutorials where he has released thousands of free and premium web development tutorials. Scott also is the co-host of the popular web development podcast Syntax. In his free time Scott is a dedicated Bboy (breakdancer) & enjoys pushing himself athletically through dance, working out and snowboarding.

    Marcy Sutton

    a11y with Marcy Sutton

    Marcy is a Senior Front-End Engineer at Deque Systems, where she works on the axe-core team focusing on accessibility test integrations into web developer tooling.

    Jessica Kerr

    Static Types with Jessica Kerr

    Symmathecist, developer, speaker, mother, crazy nut. Atomist. Learning and growing.

    J.B. Rainsberger

    Testing Practices with J.B. Rainsberger

    J. B. Rainsberger teaches programmers to write software with less stress. Testing plays a significant role in stress reduction. He writes, teaches, speaks, and coaches not only programmers and organizations, but also his fellow coaches.

    Angie Jones

    Visual regression testing with Angie Jones

    Angie Jones is a Senior Developer Advocate who specializes in test automation strategies and techniques. She shares her wealth of knowledge by speaking and teaching at software conferences all over the world.

    Jared Forsyth

    Snapshots and Reason with Jared Forsyth

    Jared is a mobile & web developer for Khan Academy, he’s working to bring a world-class education to everyone.

    Justin Searls

    Testing culture with Justin Searls

    Occasional conference talk speedrunner. Salt mining instructor at @testdouble.

    Rosie Shery

    Ministry of testing with Rosie Sherry

    Rosie is a founder of Software Testing Club, she loves all things communities, bootstrapping and unschooling.

    Kent Beck

    Craftmanship with Kent Beck

    Kent is Original signer of the Agile Manifesto, Author of the Extreme Programming book series, rediscoverer of Test-Driven Development, and inspiring Keynote Speaker.

    Printables

    The Essential Testing Glossary

    The Essential Testing Glossary

    Full Annotated Transcripts

    Full Annotated Transcripts

    JavaScript Testing Poster

    JavaScript Testing Poster

    Testing Checklist

    Testing Checklist

    Kent C. Dodds

    Hi, I'm Kent C. Dodds, the creator of this course.

    I'm a full-stack JavaScript engineer at PayPal where I've helped build products shipped to millions of users all over the globe. I represent PayPal on the TC39. I'm a Google Developer Expert and I've been teaching on egghead.io for four years. I'm happily married and the father of four kids (and one dog). I like my family, code, JavaScript, React, and of course, testing!

    Start testing like a pro

    Buy once. Forever yours.
    Silver Trophy

    Standard Testing

    usd$--
    Comprehensively test your apps.

    Standard Testing is perfect if you are ready to start testing as a priority for your applications.

    • abstract illustration for moduleFundamentals of Testing in JavaScript
    • abstract illustration for moduleStatic Analysis Testing JavaScript Applications
    • abstract illustration for moduleJavaScript Mocking Fundamentals
    • abstract illustration for moduleConfigure Jest for Testing JavaScript Applications
    • abstract illustration for moduleInstall, Configure, and Script Cypress for JavaScript Web Applications
    • 5 testing modules
    • Streaming access
    • Basic Transcripts
    Sparkle
    Sparkle
    Sparkle
    Golden Trophy

    Pro Testing

    usd$--
    Write well tested JavaScript

    Professional Testing is for you if you are ready to commit to building fully tested applications for your users.

    • abstract illustration for moduleFundamentals of Testing in JavaScript
    • abstract illustration for moduleStatic Analysis Testing JavaScript Applications
    • abstract illustration for moduleJavaScript Mocking Fundamentals
    • abstract illustration for moduleConfigure Jest for Testing JavaScript Applications
    • abstract illustration for moduleInstall, Configure, and Script Cypress for JavaScript Web Applications
    • abstract illustration for moduleTest React Components with Jest and react-testing-library
    • abstract illustration for moduleUse dom-testing-library to test any JS framework
    • All 7 modules in this course including testing React and other frameworks
    • Stream & Download
    • 9 bonus video interviews with testing experts
    • Fully annotated transcripts with inline code and screenshots
    • Full source code for all modules
    • Printable testing checklist and cheat sheets

    For Teams

    usd$--

    Excellent for teams of any size.

    Bulk discounts applied for 10+

    You’ll be emailed coupon codes to activate Pro Testing plan that you can share with your team, friends, colleagues, or use yourself. Please be sure to double check your email address. This is important!

    Bronze Trophy

    Basic Testing

    usd$--
    Get started testing JavaScript

    Basic Testing is perfect if you want to learn the basics of testing, but aren't ready to commit to fully testing your applications.

    • abstract illustration for moduleFundamentals of Testing in JavaScript
    • abstract illustration for moduleStatic Analysis Testing JavaScript Applications
    • abstract illustration for moduleJavaScript Mocking Fundamentals
    • 3 intro modules
    • Streaming access
    • Basic Transcripts
    100% 30 day money back guarantee

    What other developers are saying

    "Kent is a reliable and enthusiastic teacher. His value as a JavaScript community member can't be overstated. He will help you meet your goals as a developer."

    Dan Abramov

    Dan Abramov

    React Core team member and Co-author of Redux and Create React App

    "So I had the privilege of reviewing videos for upcoming testingjavascript.com by Kent C. Dodds - the 17 Cypress.io videos are A-M-A-Z-I-N-G. Clear, immediately useful, full of great tips for end-to-end testing."

    Gleb Bahmutov

    Gleb Bahmutov

    Vice President of Engineering Cypress.io and Microsoft MVP for OSS

    "Whether you're developing an open-source library or shipping an app to production, you need to test your code. Kent's fun and engaging course will transform you into a testing expert, so you can be confident in what you're releasing."

    Peggy Rayzis

    Peggy Rayzis

    Engineering manager at Apollo GraphQL

    "Kent has amazing videos covering a range of JavaScript topics. Not only does he show how to perform a task, but he also explains why and regularly unpacks what is happening behind the scenes. If you're looking for quick and concise videos, then consider taking his content for a spin!"

    Elijah Manor

    Elijah Manor

    PluralSight author and Egghead.io Instructor

    "Kent does an amazing job of showing how mocking works using Jest, and how to dig deep past the basics, to really understand what's going on. The section on testing fundamentals is great. Kent breaks down the basics of testing, using up-to-date techniques and shows how to build useful utilities no matter what testing framework you're using."

    Joe Eames

    Joe Eames

    PluralSight author, testing evangelist, and conference organizer

    "There are very few people on the planet who I'd trust more to learn about testing JavaScript applications from than Kent. What makes this course special is Kent is on the forefront of both testing and creating educational content. He's not just an educator creating technical content nor is he an engineer who wanted to teach, he's both and he does both at an extremely high level. I'm confident there's no better place to learn about testing than testingjavascript.com"

    Tyler McGinnis

    Tyler McGinnis

    Educator at TylerMcGinnis.com, Google Developer Expert, and Creator of Udacity's React Nanodegree

    "Many devs not only don't know how to test React components, but are also unsure of what to test. Kent's clear step-by-test course explains it all in such a way that it'll make you want to immediately go and test your whole app!"

    Ben Ilegbodu

    Ben Ilegbodu

    UI Architect & Speaker and Principal Frontend Engineer Eventbrite

    "Kent's signature style of teaching where we all discover concepts together by first implementing them and then finding that the more robust solution is a popular library. This makes learnings more relatable and permanent! Also, watch out for the cool little dev tips like how require.cache works. Those were my favorite!"

    Pavithra Kodmad

    Pavithra Kodmad

    UI Engineer Atlassian

    "I've been trying to get better at testing my code for years, but it always ended in futility. Testing the wrong things while bugs still slipped through. This course is what I've been looking for.This course is for any javascript developer that wants to be confident on release day. My Angular apps will leverage these ideas starting today."

    Isaac Mann

    Isaac Mann

    Frontend Angular Engineer at MVP Systems and Egghead.io instructor

    "When it comes to learning about testing, my time has been most well-spent learning from Kent C. Dodds and his testing courses. He has a natural ability to explain fundamentals of testing in both framework-specific and framework-agnostic ways, using short videos that keep your attention throughout. I highly recommend learning from Kent!"

    Natalie Qabazard

    Natalie Qabazard

    Engineer at Slack

    "This is the best guide for configuring Jest I’ve found on the web! Kent walks you through everything from npm install to configuring multiple Jest projects and custom runners in a really easy to understand way. Cannot recommend enough!"

    Rick Hanlon

    Rick Hanlon

    Engineer at Facebook and Jest maintainer

    "Sometimes testing feels like a religion and I belong to the church of Kent C. Dodds. Tests should help you write better code not feel like you're just writing it twice. Kent's no-frills approach in TestingJavaScript.com will get your application's tests in shape."

    Ryan Florence

    Ryan Florence

    Creator of react-router and @reach/router, teacher, consultant, and open source developer

    FAQ

    Will the modules in the course be updated as software changes?

    Yes. I plan on maintaining this course! It generally ignores the "implementation details" and sticks to fundamental evergreen approaches for testing your apps, but as things changes they will be updated here.

    What if I don't like the course?

    You're gonna love it, it's extremely valuable useful tools to add to you arsenal, but if you don't there is a 100% 30-day money back guarantee.

    Is this course complete?

    YES! We are still finishing a few of the bonus items, but will be sending those out ASAP.

    Is this an egghead.io course?

    This course is built on the egghead.io infrastructure, but is not scheduled to be released on egghead.io.

    Is this content new, or is it the same as your Frontend Masters workshops?

    This is new content recorded exclusively for this course. It is very dense, with a lot more information, and a lot of fantastic bonuses. You’ll like it.

    Who is this course for?

    This course is for anybody building web applications with JavaScript. It assumes that you know how to use modern JavaScript and have some experience building applications.

    If you’ve never tested your apps before, this is a great place to start. If you are a seasoned pro delivering well tested applications, this should be a solid review, reference, and will definitely teach you some new patterns and practices.

    This course isn’t for you if you believe shipping well-tested quality JavaScript apps to your users is a waste of time.

    Are there any discounts available?

    The best price is the one you see listed on this page. There are no hidden discounts.

    Can I get more details on this course?

    Yes!! I recorded a detailed walk through of the entire course and what you will get.

    Something has gone horribly wrong, how can I get help?

    Oh no! There is a gray buoy in the lower right side of the screen or email help@testingjavascript.com.