MCPcopy Index your code
hub / github.com/coder/coder / TestTemplate

Function TestTemplate

examples/examples_test.go:16–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestTemplate(t *testing.T) {
17 t.Parallel()
18 list, err := examples.List()
19 require.NoError(t, err, "error listing examples, run \"make gen\" to ensure examples are up to date")
20 require.NotEmpty(t, list)
21 for _, eg := range list {
22 t.Run(eg.ID, func(t *testing.T) {
23 t.Parallel()
24 assert.NotEmpty(t, eg.ID, "example ID should not be empty")
25 assert.NotEmpty(t, eg.URL, "example URL should not be empty")
26 assert.NotEmpty(t, eg.Name, "example name should not be empty")
27 assert.NotEmpty(t, eg.Description, "example description should not be empty")
28 assert.NotEmpty(t, eg.Markdown, "example markdown should not be empty")
29 assert.NotNil(t, eg.Tags, "example tags should not be nil, should be empty array if no tags")
30 _, err := examples.Archive(eg.ID)
31 assert.NoError(t, err, "error archiving example")
32 })
33 }
34}
35
36func TestSubdirs(t *testing.T) {
37 t.Parallel()

Callers

nothing calls this directly

Calls 4

ListFunction · 0.92
ArchiveFunction · 0.92
NotEmptyMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected