Last active
June 13, 2022 20:00
-
-
Save davidbarral/0f035a9e1dfad8b496ba40edcf633d4c to your computer and use it in GitHub Desktop.
DI Purist 3
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
const updateUserPreference = require("./use-cases/update-user-preference.js"); | |
it("updates the user preference", () => { | |
const mockUpdate = jest.fn(); | |
const mockRepo = { update: mockUpdate }; | |
updateUserPreference({ key: "someKey", value: "someValue", { user: mockRepo }); | |
expect(mockUpdate).toHaveBeenCalledWith(/* the updatedUser */); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment