1
0
mirror of https://github.com/smallstep/cli.git synced 2025-04-19 10:42:15 +03:00

Fix tests for token flow having different error message

Depending on whether the test is executed in CI/VSCode vs. running
them locally with `make test`, the resulting error message was
different for the `multiple-select-ui` and `ignore-provisioner-flag`
test cases. For now we just test for an error, but it would be
nice to refactor a bit and trigger specific error cases in the
future.
This commit is contained in:
Herman Slatman 2025-04-15 14:49:18 +02:00
parent 65cf93ec88
commit b14f5534e0
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

View File

@ -91,8 +91,7 @@ func TestProvisionerPromptPrompts(t *testing.T) {
p2 := &provisioner.SCEP{Name: "scep"}
got, err := provisionerPrompt(clictx, []provisioner.Interface{p1, p2})
require.Nil(t, got)
require.ErrorContains(t, err, "error allocating terminal") // TODO(hs): would be nice to refactor to configurable output
require.Error(t, err) // TODO(hs): would be nice to refactor to configurable output, and catch specific error cases (again)
require.Nil(t, got)
})
@ -158,7 +157,7 @@ func TestProvisionerPromptPrompts(t *testing.T) {
p2 := &provisioner.OIDC{Name: "oidc-2", ClientID: "client-id-1"}
got, err := provisionerPrompt(clictx, []provisioner.Interface{p1, p2})
require.ErrorContains(t, err, "error allocating terminal") // TODO(hs): would be nice to refactor to configurable output
require.Error(t, err) // TODO(hs): would be nice to refactor to configurable output, and catch specific error cases (again)
require.Nil(t, got)
})
}