Last active
November 23, 2016 02:46
-
-
Save mearns/89ede12158541296b717b12e3521d4d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GIVEN | |
const http = require('some-well-known-http-request-module'); | |
sandbox.stub(http, 'post').returns(EXPECTED_RESPONSE_BODY); | |
sandbox.stub(http, 'config'); | |
// WHEN | |
makeRestApiCall(EXPECTED_POST_DATA); | |
// THEN | |
expect(http.config).to.have.been.calledWith({ baseUrl: 'http://example.com/rest/api/' }); | |
expect(http.post).to.have.been.calledWith('expectedEndpoint', EXPECTED_POST_DATA); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment