Skip to content

Commit

Permalink
Update mocks.md
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen authored Jul 24, 2023
1 parent f28ae01 commit 9f6d4a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/pages/docs/reference/features/mocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestGetPostTitle_returns(t *testing.T) {
// and makes sure that all of them succeeded
defer ensure(t)

expected := &db.PostModel{
expected := db.PostModel{
InnerPost: db.InnerPost{
ID: "123",
Title: "foo",
Expand All @@ -58,7 +58,7 @@ func TestGetPostTitle_returns(t *testing.T) {
client.Post.FindUnique(
db.Post.ID.Equals("123"),
),
).Returns(*expected) // sets the object which should be returned in the function call
).Returns(expected) // sets the object which should be returned in the function call

// mocking set up is done; let's define the actual test now
title, err := GetPostTitle(context.Background(), client, "123")
Expand Down

0 comments on commit 9f6d4a4

Please sign in to comment.