INNER CODE UNIT · Go

TestBatchComplexVersion

miniscruff/changie · cmd/batch_test.go:191

func TestBatchComplexVersion(t *testing.T) {
	cfg := batchTestConfig()
	cfg.EnvPrefix = "TEST_CHANGIE_"
	cfg.HeaderFormat = "{{ bodies .Changes | len }} changes this release"
	cfg.ChangeFormat = "* {{.Body}} by {{.Custom.Author}}"
	cfg.FooterFormat = `### contributors
{{- range (customs .Changes "Author" | uniq) }}
* [{{.}}](https://github.com/{{.}})
{{- end}}
env: {{.Env.ENV_KEY}}`
	cfg.VersionFormat = "## {{.VersionNoPrefix}}"

	then.WithTempDirConfig(t, cfg)
	t.Setenv("TEST_CHANGIE_ENV_KEY", "env value")

	batch := NewBatch(time.Now, core.NewTemplateCache())
	batch.IncludeDirs = []string{"beta"}
	batch.Prerelease = []string{"b1"}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…