http://kuukkanen.i2p/posts/testing
Now continuing the
example we could split the code in the following way: const validateInput = ( name , password ) => typeof name !== "string" || typeof password !== "string" || name . length < 4 || password . length < 10 ; const createUser = ( name , password ) => ({ name , password : hashPassword ( password ), }); api . post ( "/user" , ( req , res ) => { const data = JSON . parse ( req . body ); if (...