Somehow directly returning HTTP status codes from the backend feels wrong to me. Maybe we can re-define getTest to return an object with an 'error' member instead? Something like this:
{ error: { code: 404, message: 'No tests to run for this commit' } } // error case
{ error: { code: 426, message: 'Commit too old' } } // error case
{ test: '{prefix:....}'} // no error