Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add more integrity tests #492

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions testdata/add.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
exec git init
exec lefthook add pre-commit
! stderr .
exists .git/hooks/pre-commit
! exists .lefthook/pre-commit

exec lefthook add pre-push --dirs
! stderr .
exists .git/hooks/pre-push
exists .lefthook/pre-push
exists .lefthook-local/pre-push
23 changes: 23 additions & 0 deletions testdata/run_json.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
exec git init
exec git config user.email "you@example.com"
exec git config user.name "Your Name"
exec git add -A
exec lefthook install
exec git commit -m 'test'
stderr '\s*Hi there from Lefthook\s*'

-- lefthook.json --
{
"skip_output": [
"meta",
"summary",
"execution_info"
],
"pre-commit": {
"commands": {
"echo": {
"run": "echo Hi there from Lefthook"
}
}
}
}
18 changes: 18 additions & 0 deletions testdata/run_toml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
exec git init
exec git config user.email "you@example.com"
exec git config user.name "Your Name"
exec git add -A
exec lefthook install
exec git commit -m 'test'
stderr '\s*Hi there from Lefthook\s*'

-- lefthook.toml --
skip_output = [
'meta',
'summary',
'execution_info',
]

[pre-commit.commands.echo]
run = "echo Hi there from Lefthook"

17 changes: 17 additions & 0 deletions testdata/run_yml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
exec git init
exec git config user.email "you@example.com"
exec git config user.name "Your Name"
exec git add -A
exec lefthook install
exec git commit -m 'test'
stderr '\s*Hi there from Lefthook\s*'

-- lefthook.yml --
skip_output:
- meta
- summary
- execution_info
pre-commit:
commands:
echo:
run: echo Hi there from Lefthook
18 changes: 18 additions & 0 deletions testdata/uninstall.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
exec git init
exec lefthook install
exists .git/hooks/pre-push
exec lefthook uninstall
! exists .git/hooks-pre-push
exists lefthook.yml

exec lefthook install
exists .git/hooks/pre-push
exec lefthook uninstall -c
! exists .git/hooks-pre-push
! exists lefthook.yml

-- lefthook.yml --
pre-push:
commands:
echo:
run: echo pre-push
Loading