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:
@@ -29,7 +29,7 @@ func TestExternalAuth(t *testing.T) {
|
||||
inv, _ := clitest.New(t, "--agent-url", url, "--agent-token", "foo", "external-auth", "access-token", "github")
|
||||
stdout := expecter.NewAttachedToInvocation(t, inv)
|
||||
waiter := clitest.StartWithWaiter(t, inv)
|
||||
stdout.ExpectMatchContext(ctx, "https://github.com")
|
||||
stdout.ExpectMatch(ctx, "https://github.com")
|
||||
waiter.RequireIs(cliui.ErrCanceled)
|
||||
})
|
||||
t.Run("SuccessWithToken", func(t *testing.T) {
|
||||
@@ -45,7 +45,7 @@ func TestExternalAuth(t *testing.T) {
|
||||
inv, _ := clitest.New(t, "--agent-url", url, "--agent-token", "foo", "external-auth", "access-token", "github")
|
||||
stdout := expecter.NewAttachedToInvocation(t, inv)
|
||||
clitest.Start(t, inv)
|
||||
stdout.ExpectMatchContext(ctx, "bananas")
|
||||
stdout.ExpectMatch(ctx, "bananas")
|
||||
})
|
||||
t.Run("NoArgs", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
@@ -76,6 +76,6 @@ func TestExternalAuth(t *testing.T) {
|
||||
inv, _ := clitest.New(t, "--agent-url", url, "--agent-token", "foo", "external-auth", "access-token", "github", "--extra", "hey")
|
||||
stdout := expecter.NewAttachedToInvocation(t, inv)
|
||||
clitest.Start(t, inv)
|
||||
stdout.ExpectMatchContext(ctx, "there")
|
||||
stdout.ExpectMatch(ctx, "there")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user