Skip to content

Commit

Permalink
chore: add a small test that runs skips LFS
Browse files Browse the repository at this point in the history
  • Loading branch information
zachahn-gusto committed Nov 27, 2024
1 parent beeaef7 commit 5a00fb0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/lefthook/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func TestRunAll(t *testing.T) {
success, fail []Result
gitCommands []string
force bool
skipLFS bool
}{
"empty hook": {
hookName: "post-commit",
Expand Down Expand Up @@ -716,6 +717,21 @@ func TestRunAll(t *testing.T) {
"git diff --name-only HEAD @{push}",
},
},
"with LFS disabled": {
hookName: "post-checkout",
skipLFS: true,
existingFiles: []string{
filepath.Join(root, "README.md"),
},
hook: &config.Hook{
Commands: map[string]*config.Command{
"ok": {
Run: "success",
},
},
},
success: []Result{succeeded("ok")},
},
} {
fs := afero.NewMemMapFs()
repo.Fs = fs
Expand All @@ -727,6 +743,7 @@ func TestRunAll(t *testing.T) {
LogSettings: log.NewSettings(),
GitArgs: tt.args,
Force: tt.force,
SkipLFS: tt.skipLFS,
},
executor: executor{},
cmd: cmd{},
Expand Down

0 comments on commit 5a00fb0

Please sign in to comment.