http://kuukkanen.i2p/posts/testing
Testing the soundness of your logic Now that we have separate units in place we can start testing those. It’s easy
to test the validation logic with something like this: test ( "valid input" , () => { expect ( validateInput ( "user" , "password1234" )). toBe ( true ); }); test ( "invalid input" , () => { expect ( validateInput ( "" , "" )). toBe ( false ); expect ( validateInput ( "usr" , "password1234" )). toBe ( false ); expect ( validateInput ( "user" , "password" )). toBe ( false );...