Skip to content

Commit

Permalink
chore: improve correctness of load_test.go (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall authored Jul 19, 2023
1 parent b7c60cd commit ef136c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/config/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ run = "echo 1"
t.Errorf("unexpected error: %s", err)
}

jsonConfig := filepath.Join(root, "lefthook.yml")
jsonConfig := filepath.Join(root, "lefthook.json")
if err = fs.WriteFile(jsonConfig, []byte(tt.json), 0o644); err != nil {
t.Errorf("unexpected error: %s", err)
}
Expand All @@ -741,7 +741,7 @@ run = "echo 1"
t.Errorf("(-want +got):\n%s", cmp.Diff(tt.result, checkConfig))
}

if err = fs.Remove(yamlConfig); err != nil {
if err = fs.Remove(jsonConfig); err != nil {
t.Errorf("unexpected error: %s", err)
}

Expand All @@ -757,6 +757,10 @@ run = "echo 1"
t.Errorf("configs should be equal")
t.Errorf("(-want +got):\n%s", cmp.Diff(tt.result, checkConfig))
}

if err = fs.Remove(tomlConfig); err != nil {
t.Errorf("unexpected error: %s", err)
}
})
}
}

0 comments on commit ef136c4

Please sign in to comment.