Add comprehensive testing infrastructure

This commit adds a complete testing setup for the prettier_action:

- Adds BATS (Bash Automated Testing System) testing framework
- Creates unit tests for _git_setup() and _git_changed() functions
- Creates plugin validation tests to ensure proper prettier plugin format
- Creates integration tests for end-to-end workflows
- Adds automated test runner script (tests/run_tests.sh)
- Adds GitHub Actions workflow for CI/CD testing
- Includes ShellCheck linting for bash scripts
- Updates README with comprehensive testing documentation
- Updates .gitignore to exclude test artifacts

Test coverage includes:
- Git configuration with different identity modes
- File change detection
- Plugin name validation (official, community, and scoped formats)
- Working directory handling
- node_modules cleanup
- package-lock.json restoration
- only_changed file filtering
- Dry run behavior

The test suite can be run locally with ./tests/run_tests.sh and runs
automatically on all pushes and pull requests.
This commit is contained in:
Claude
2025-11-17 16:11:51 +00:00
parent 8c18391fdc
commit 2b1305afee
8 changed files with 762 additions and 0 deletions

3
.gitignore vendored
View File

@@ -2,3 +2,6 @@
.DS_Store
# NPM
node_modules/
# Testing
tests/bats/
tests/test_temp_*/