(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func TestTables(t *testing.T) { |
| 36 | configs := []struct { |
| 37 | name string |
| 38 | config string |
| 39 | format string |
| 40 | }{ |
| 41 | { |
| 42 | name: "should generate tables in default format", |
| 43 | config: "multiple-sources.yml", |
| 44 | }, |
| 45 | { |
| 46 | name: "should generate tables in json format", |
| 47 | config: "multiple-sources.yml", |
| 48 | format: "json", |
| 49 | }, |
| 50 | { |
| 51 | name: "should generate tables in markdown format", |
| 52 | config: "multiple-sources.yml", |
| 53 | format: "markdown", |
| 54 | }, |
| 55 | } |
| 56 | |
| 57 | for _, tc := range configs { |
| 58 | t.Run(tc.name, func(t *testing.T) { |
| 59 | cmd, docsDir := getTablesCommand(t, tc.config, tc.format, "") |
| 60 | commandError := cmd.Execute() |
| 61 | require.NoError(t, commandError) |
| 62 | |
| 63 | if tc.format == "markdown" { |
| 64 | require.FileExists(t, path.Join(docsDir, "cq-docs/test/README.md")) |
| 65 | } else { |
| 66 | require.FileExists(t, path.Join(docsDir, "cq-docs/test/__tables.json")) |
| 67 | } |
| 68 | }) |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func TestTablesWithFilter(t *testing.T) { |
| 73 | configs := []struct { |
nothing calls this directly
no test coverage detected