1
0
mirror of https://github.com/go-task/task.git synced 2025-06-23 00:38:19 +02:00

chore: replace PPRemoveAbsolutePaths with generic fixture template data

This commit is contained in:
Pete Davison
2025-05-21 14:32:37 +00:00
parent ec4e68d601
commit 85d3754ac0
21 changed files with 77 additions and 59 deletions

View File

@ -44,7 +44,8 @@ func NewFormatterTest(t *testing.T, opts ...FormatterTestOption) {
task: "default",
vars: map[string]any{},
TaskTest: TaskTest{
experiments: map[*experiments.Experiment]int{},
experiments: map[*experiments.Experiment]int{},
fixtureTemplateData: map[string]any{},
},
}
// Apply the functional options
@ -222,8 +223,6 @@ func TestListDescInterpolation(t *testing.T) {
func TestJsonListFormat(t *testing.T) {
t.Parallel()
fp, err := filepath.Abs("testdata/json_list_format/Taskfile.yml")
require.NoError(t, err)
NewFormatterTest(t,
WithExecutorOptions(
task.WithDir("testdata/json_list_format"),
@ -231,10 +230,6 @@ func TestJsonListFormat(t *testing.T) {
WithListOptions(task.ListOptions{
FormatTaskListAsJSON: true,
}),
WithFixtureTemplateData(struct {
TaskfileLocation string
}{
TaskfileLocation: fp,
}),
WithFixtureTemplating(),
)
}