mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test: rename ExpectMatchContext to ExpectMatch (#25998)
Cleans the last few instances of ExpectMatch that didn't use the new `(ctx, ...)` variant, then deletes the deprecated method and renames `ExpectMatchContext` to drop the `Context` suffix.
This commit is contained in:
@@ -37,14 +37,14 @@ func TestGitAskpass(t *testing.T) {
|
||||
inv.Environ.Set("CODER_AGENT_TOKEN", "fake-token")
|
||||
stdout := expecter.NewAttachedToInvocation(t, inv)
|
||||
clitest.Start(t, inv)
|
||||
stdout.ExpectMatchContext(ctx, "something")
|
||||
stdout.ExpectMatch(ctx, "something")
|
||||
|
||||
inv, _ = clitest.New(t, "--agent-url", url, "Password for 'https://potato@github.com':")
|
||||
inv.Environ.Set("GIT_PREFIX", "/")
|
||||
inv.Environ.Set("CODER_AGENT_TOKEN", "fake-token")
|
||||
stdout = expecter.NewAttachedToInvocation(t, inv)
|
||||
clitest.Start(t, inv)
|
||||
stdout.ExpectMatchContext(ctx, "bananas")
|
||||
stdout.ExpectMatch(ctx, "bananas")
|
||||
})
|
||||
|
||||
t.Run("NoHost", func(t *testing.T) {
|
||||
@@ -63,7 +63,7 @@ func TestGitAskpass(t *testing.T) {
|
||||
stdout := expecter.NewAttachedToInvocation(t, inv)
|
||||
err := inv.Run()
|
||||
require.ErrorIs(t, err, cliui.ErrCanceled)
|
||||
stdout.ExpectMatchContext(ctx, "Nope!")
|
||||
stdout.ExpectMatch(ctx, "Nope!")
|
||||
})
|
||||
|
||||
t.Run("Poll", func(t *testing.T) {
|
||||
@@ -99,11 +99,11 @@ func TestGitAskpass(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
testutil.RequireReceive(ctx, t, poll)
|
||||
stderr.ExpectMatchContext(ctx, "Open the following URL to authenticate")
|
||||
stderr.ExpectMatch(ctx, "Open the following URL to authenticate")
|
||||
resp.Store(&agentsdk.ExternalAuthResponse{
|
||||
Username: "username",
|
||||
Password: "password",
|
||||
})
|
||||
stdout.ExpectMatchContext(ctx, "username")
|
||||
stdout.ExpectMatch(ctx, "username")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user