Showing posts from April, 2021

Dependency Injection in TypeScript

In modern programming languages, such as JavaScript and TypeScript, dependency injection (DI) has become a fundamental concept. TypeScript, in particular, has gained significant popularity in recent years, and developers often …

Mocking- A guide to mock jQuery ajax using Jest

This is my personal favourite tip from the collection. In almost every project, we used an ajax call. Ajax testing is difficult because it is dependent on an external source. In this example, I’ll show you how to use jest to tes…

How to mock jQuery selector and return HTML element using JEST

When you have DOM dependency in your javascript application, you can easily mock the dom elements and return the HTML element. Consider the following code snippet for this example. The CSS class is added and removed based on th…

Load More
That is All