Skip to content

Instantly share code, notes, and snippets.

@andregardi
Last active March 21, 2019 15:42
Show Gist options
  • Select an option

  • Save andregardi/efb79d434fda7dfd7ca9a914f158065f to your computer and use it in GitHub Desktop.

Select an option

Save andregardi/efb79d434fda7dfd7ca9a914f158065f to your computer and use it in GitHub Desktop.
import { reposServiceFunction } from "./repos";
describe("repos service", () => {
const mockAxios = {
get: jest.fn()
};
it("should call axios with repos url", () => {
const username = "user";
reposServiceFunction(mockAxios).getResposByUserName(username);
expect(mockAxios.get).toHaveBeenLastCalledWith(`https://api.github.com/users/${username}/repos`);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment