See Testim Copilot in action | Join us

Tag: unit testing

Mocha is a popular JavaScript test framework that’s often used for testing Node.js applications. It’s a widely used testing tool for both JavaScript and TypeScript projects. However, using Mocha with TypeScript is a little different than JavaScript because TypeScript is a typed superset of JavaScript and, thus, requires type definitions for many of its features….

Writing unit test cases is an import task for a developer. With proper unit testing, you’ll have fewer bugs in the final product. This post will compare two popular testing libraries for React applications: the React Testing Library and Enzyme. We’ll also go through some code examples and show you the strengths and weaknesses of…

Although the benefits of having automated tests are well known, setting up any new test framework can be bewildering and time consuming. If you’re writing JavaScript, a language that lies somewhere in the middle between object-oriented and functional programming, understanding what to test can be hard too. This tutorial will explain the basics of testing…

Many people, upon hearing “automated testing,” automatically think of unit tests. That’s understandable; after all, unit testing is one of the most well-known types of automated tests. However, it’s far from being the only one. We have UI testing, end-to-end testing, load testing, and that’s just to name a few. Today’s post—as you can see…

We all know that unit tests must not interact with external dependencies—databases, HTTP services, the filesystem, etc. You must resort to mocking those dependencies. This presents a problem: sometimes you have to mock code you didn’t write, presented in the form of static methods. In this post, you’ll learn how to deal with this challenge…

Getting started with unit testing can seem like a daunting task. There’s plenty to learn, such as what unit testing is in the first place and why it’s valuable, what the best practices are when writing tests, and which tools to choose. We’ve already published a post covering the unit test frameworks for JavaScript; now,…

When it comes to unit testing frameworks for JavaScript, Jest is certainly a serious contender for the #1 spot. Initially, Jest was created by Facebook specifically for testing React applications. It’s one of the most popular ways of testing React components. Since its introduction, the tool has gained a lot of popularity. This popularity has…

Unit testing’s benefits aren’t restricted to just a few languages. To prove that, today, we’re focusing on TypeScript unit testing. In this post, you’ll learn how to unit test your TypeScript code in a hands-on tutorial. You’ll also learn what unit testing is and what you gain from using it. Since this is a tutorial,…

Automated testing is a must for any modern software development organization. That’s why you must know and master tools in that space if you have any hope of producing high-quality code. Fortunately, there is a huge variety of testing tools available. These tools cater to virtually every need of a comprehensive testing strategy. When it…

Components are one of the basic concepts of Angular applications. Thus, if you want to make sure your app is as high quality as it can possibly be, you’ve got to give those basic building blocks some love. When it comes to software quality, testing is caring, so let’s see how to perform Angular unit…