Skip to content

Commit

Permalink
Added a reset command.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Sep 18, 2024
1 parent 8bf042d commit 9c3df9a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"rector --clear-cache",
"cp php-script php-script.php && phpcbf; rm php-script.php"
],
"reset": "rm -Rf vendor vendor-bin composer.lock",
"test": "phpunit --no-coverage",
"test-coverage": "phpunit"
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"build": "echo Would run build",
"lint": "echo Would run code lint",
"lint-fix": "echo Would run code lint fix",
"test": "echo Would run tests"
"test": "echo Would run tests",
"reset": "rm -Rf node_modules package-lock.json"
},
"engines": {
"npm": ">=8.0.0",
Expand Down
12 changes: 11 additions & 1 deletion tests/scaffold/functional.composer.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@ load _helper
BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1

@test "Composer scripts - lint" {
composer install
assert_dir_not_exists "vendor"
assert_file_not_exists "composer.lock"
run composer install
assert_success
assert_dir_exists "vendor"
assert_file_exists "composer.lock"

run composer lint
assert_success

run composer reset
assert_success
assert_dir_not_exists "vendor"
assert_file_not_exists "composer.lock"
}

@test "Composer scripts - test" {
Expand Down

1 comment on commit 9c3df9a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.