@@ -80,6 +80,12 @@ func TestServer(t *testing.T) {
80
80
go func () {
81
81
err := root .ExecuteContext (ctx )
82
82
require .ErrorIs (t , err , context .Canceled )
83
+
84
+ // Verify that credentials were output to the terminal.
85
+ wantEmail := "email: admin@coder.com"
86
+ wantPassword := "password: password"
87
+ assert .Contains (t , stdoutBuf .String (), wantEmail , "expected output %q; got no match" , wantEmail )
88
+ assert .Contains (t , stdoutBuf .String (), wantPassword , "expected output %q; got no match" , wantPassword )
83
89
}()
84
90
var token string
85
91
require .Eventually (t , func () bool {
@@ -92,11 +98,6 @@ func TestServer(t *testing.T) {
92
98
require .NoError (t , err )
93
99
parsed , err := url .Parse (accessURL )
94
100
require .NoError (t , err )
95
- // Verify that credentials were output to the terminal.
96
- wantEmail := "email: admin@coder.com"
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 )
100
101
client := codersdk .New (parsed )
101
102
client .SessionToken = token
102
103
_ , err = client .User (ctx , codersdk .Me )
0 commit comments