Skip to content

Commit 1d28609

Browse files
Added <h1> and fixed typo in mock article
1 parent 60f706e commit 1d28609

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/content/blog/mocking-interfaces-in-go.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ func TestGreeting(t *testing.T) {
174174
}
175175
```
176176

177-
If we run this, it'll compile, but we'll see an `Unexpected call` error, telling us that there are no calls of the `Translate` method. This is because, while we have a struct that the mock should be called.
177+
If we run this, it'll compile, but we'll see an `Unexpected call` error, telling us that there are no calls of the `Translate` method. This is because, our mock is smart enough to fail the test when we call it unexpectedly.
178178

179-
The mock is smart enough to fail the test when we call it unexpectedly. Let's define a behavior for the mock.
179+
Let's define a behavior for the mock and an expectation that it'll be called once.
180180

181181
```go {6-8} title="person_test.go"
182182
func TestGreeting(t *testing.T) {

src/pages/index.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const posts = (await getNonDraftPosts()).sort(
1313
<Layout title={SITE_TITLE} description={SITE_DESCRIPTION}>
1414
<main>
1515
<section>
16+
<h1>Blog Posts</h1>
1617
<ul>
1718
<PostPreview
1819
post={posts.at(0) as CollectionEntry<"blog">}

0 commit comments

Comments
 (0)