mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
fix: enrich the notLoggedInMessage
error message with the full path to the coder (#17715)
--------- Signed-off-by: Callum Styan <callumstyan@gmail.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package cli_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"testing"
|
||||
@ -89,10 +90,14 @@ func TestLogout(t *testing.T) {
|
||||
logout.Stdin = pty.Input()
|
||||
logout.Stdout = pty.Output()
|
||||
|
||||
executable, err := os.Executable()
|
||||
require.NoError(t, err)
|
||||
require.NotEqual(t, "", executable)
|
||||
|
||||
go func() {
|
||||
defer close(logoutChan)
|
||||
err := logout.Run()
|
||||
assert.ErrorContains(t, err, "You are not logged in. Try logging in using 'coder login <url>'.")
|
||||
err = logout.Run()
|
||||
assert.Contains(t, err.Error(), fmt.Sprintf("Try logging in using '%s login <url>'.", executable))
|
||||
}()
|
||||
|
||||
<-logoutChan
|
||||
|
Reference in New Issue
Block a user