Posts

Showing posts with the label Node

Run And Debug Test Cases Using Jest With Different CLI Options

Welcome file Overview In this article, We will be looking at different ways to run Jest test cases also we will be looking at debugging test case in Jest Jest CLI provides a different options to run unit test cases. We can run Jest test cases as we want. I have described below some of the ways of to run test cases. Run all tests Run tests that are contain in a file Run all tests that are related to changed file Run tests related to path Run tests that match spec name Run only single test Skip test cases Run tests in watch mode Prerequisite You need to have Node installed in order to use npm (node package manager). After installing node we require Jest Package which will be downloaded from NPM package store Jest CLI Options Run all tests By Default Jest runs all tests jest Run tests that are contain in a file Run tests that were specified in file jest testfilename.js jest path/to/testfilename.js Run all tests that are related to changed f...