Tutorial by Examples

At its most basic level, Unit Testing in any language provides assertions against some known or expected output. function assert( outcome, description ) { var passFail = outcome ? 'pass' : 'fail'; console.log(passFail, ': ', description); return outcome; }; The popular assertio...
Here we have a simple class to be tested that returns a Promise based on the results of an external ResponseProcessor that takes time to execute. For simplicty we'll assume that the processResponse method won't ever fail. import {processResponse} from '../utils/response_processor'; const ping =...

Page 1 of 1