(t *testing.T)
| 866 | } |
| 867 | |
| 868 | func TestExportSecrets(t *testing.T) { |
| 869 | ios, _, stdout, _ := iostreams.Test() |
| 870 | tf, _ := time.Parse(time.RFC3339, "2024-01-01T00:00:00Z") |
| 871 | ss := []Secret{{ |
| 872 | Name: "s1", |
| 873 | UpdatedAt: tf, |
| 874 | Visibility: shared.All, |
| 875 | SelectedReposURL: "https://someurl.com", |
| 876 | NumSelectedRepos: 1, |
| 877 | }} |
| 878 | exporter := cmdutil.NewJSONExporter() |
| 879 | exporter.SetFields(secretFields) |
| 880 | require.NoError(t, exporter.Write(ios, ss)) |
| 881 | require.JSONEq(t, |
| 882 | `[{"name":"s1","numSelectedRepos":1,"selectedReposURL":"https://someurl.com","updatedAt":"2024-01-01T00:00:00Z","visibility":"all"}]`, |
| 883 | stdout.String()) |
| 884 | } |
nothing calls this directly
no test coverage detected