Please see https://github.com/ewolfe/http-mock to use httpmock.app programatically.