Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24c0e1c

Browse files
committed
nit: Use clearer error messages for assert
1 parent d6410d9 commit 24c0e1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cli/server_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ func TestServer(t *testing.T) {
9393
parsed, err := url.Parse(accessURL)
9494
require.NoError(t, err)
9595
// Verify that credentials were output to the terminal.
96-
assert.Contains(t, stdoutBuf.String(), "email: [email protected]", "unexpected output")
97-
assert.Contains(t, stdoutBuf.String(), "password: password", "unexpected output")
96+
wantEmail := "email: [email protected]"
97+
wantPassword := "password: password"
98+
assert.Contains(t, stdoutBuf.String(), wantEmail, "expected output %q; got no match", wantEmail)
99+
assert.Contains(t, stdoutBuf.String(), wantPassword, "expected output %q; got no match", wantPassword)
98100
client := codersdk.New(parsed)
99101
client.SessionToken = token
100102
_, err = client.User(ctx, codersdk.Me)

0 commit comments

Comments
 (0)