Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update html-templates.md: delete mistaken dependency #840

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions html-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ package blogrenderer_test

import (
"bytes"
"github.com/quii/learn-go-with-tests/blogrenderer"
"testing"
)

Expand Down Expand Up @@ -162,9 +161,7 @@ Now we have a very basic version working, we can now iterate on the test to expa
}

got := buf.String()
want := `<h1>hello world</h1>
<p>This is a description</p>
Tags: <ul><li>go</li><li>tdd</li></ul>`
want := `<h1>hello world</h1><p>This is a description</p>Tags: <ul><li>go</li><li>tdd</li></ul>`

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
Expand Down Expand Up @@ -368,7 +365,7 @@ But really, we don't actually care about whitespace. Maintaining this test will

The idea is similar to "golden" files, or snapshot testing. Rather than awkwardly maintaining strings within a test file, the approval tool can compare the output for you with an "approved" file you created. You then simply copy over the new version if you approve it. Re-run the test and you're back to green.

Add a dependency to `"github.com/approvals/go-approval-tests"` to your project and edit the test to the following
Add a dependency to `"github.com/approvals/go-approval-tests"` (with the command `go get github.com/approvals/go-approval-tests`) to your project and edit the test to the following

```go
func TestRender(t *testing.T) {
Expand Down