The most basic concept in test doubles is the dummy . When testing a function, there are usually two kinds of input: Meaningful input Data that affects the result of the function. Dummy input Data that is required by the function, but does not affect the behavior we are testing. Below is an example of meaningful data vs dummy data. This is a calculateShipping function: function calculateShipping ( weight : number , user : { id : string }, logger : { info : ( message : string ) => void } ) { return weight * 5 ; } Enter fullscreen mode Exit fullscreen mode In this function, only weight affects the result. The user and logger parameters are required, but they do not affect the shipping calculation. const meaningfulWeight = 10 ; const dummyUser = { id : " dummy-user " }; const dummyLogger = { info : () => {} }; const result = calculateShipping ( meaningfulWeight , dummyUser , dummyLogger ); expect ( result ).…