Posts

Showing posts with the label react

React Testing

Image
     Type of Tests  Easier to run  Which test to perform ?  Unit test is easier to maintain but e2e test give more confidence     Test throws an error when excpected output is not matched in o/p  CRA contains both testing library  first arg -> test name secodn arg -> i) render method create a virtual dom ii) screen gives us method to query v Dom In this image we are finding an case insensitive arg learn react   We notice that we are finding it in the doc  expect is globably imported by jest so we dont need to manually import it so we are using both testing libary at the same time. Test Driven Development  Jest watch mode  Filtering test    p to use regex pattern or only search pattern  adding only does that particular test test.skip does that reverse Grouping Test        we can also use only and skip with describe as well Possible to nest describes    1 f...