By default `Test.pendingAjaxRequest` is not setup. So I am checking for `undefined` (which indicates that it hasn't been set yet) and initializing to 0.