# Testing Commands Module # Commands for running tests, coverage, browser testing, and quality checks # Set shell for commands set shell := ["bash", "-c"] # Run all tests (default) run: @echo "๐Ÿงช Running all tests..." cargo test # Run tests with coverage coverage: @echo "๐Ÿงช Running tests with coverage..." cargo tarpaulin --out html # Run end-to-end tests e2e: @echo "๐Ÿงช Running end-to-end tests..." cd end2end && npx playwright test # Run specific test specific test: @echo "๐Ÿงช Running test: {{test}}..." cargo test {{test}} # Run tests in watch mode watch: @echo "๐Ÿงช Running tests in watch mode..." cargo watch -x test # Run expand expand *ARGS: @echo "๐Ÿงช Expand code ..." cargo expand {{ARGS}} # ============================================================================= # BROWSER TESTING COMMANDS # ============================================================================= # Test single page in browser (page-browser-tester.sh wrapper) page *ARGS: @echo "๐ŸŒ Testing page in browser..." {{justfile_directory()}}/scripts/browser-logs/page-browser-tester.sh {{ARGS}} # Generate comprehensive browser report for all pages (all-pages-browser-report.sh wrapper) pages-report *ARGS: @echo "๐Ÿ“Š Generating all pages browser report..." {{justfile_directory()}}/scripts/wrks/all-pages-browser-report.sh {{ARGS}} # Generate new page with interactive CLI page-new: @echo "๐Ÿš€ Starting interactive page generator..." cargo run --bin rustelo-manager -- --tui # ============================================================================= # CODE QUALITY COMMANDS # ============================================================================= # Check code with clippy check *ARGS: @echo "๐Ÿ” Checking code with clippy..." cargo clippy {{ARGS}} # Check all code with clippy check-all: @echo "๐Ÿ” Checking code with clippy..." cargo clippy --all-targets --all-features # Check code with strict clippy and rule validation check-strict: @echo "๐Ÿ” Checking code with strict clippy and rule validation..." @echo "๐Ÿšจ Validating Rustelo project rules..." @scripts/rules/validate-rules.nu --strict cargo clippy --all-targets --all-features -- -D warnings # Format code with rule validation format *ARGS: @echo "โœจ Formatting code..." @echo "๐Ÿšจ Pre-format rule validation..." @scripts/rules/validate-rules.nu cargo +nightly fmt {{ARGS}} @echo "๐Ÿšจ Post-format rule validation..." @scripts/rules/validate-rules.nu # Check if code is formatted format-check *ARGS: @echo "โœจ Checking code formatting..." cargo +nightly fmt --check {{ARGS}} # Security audit audit: @echo "๐Ÿ”’ Running security audit..." cargo audit # Check for unused dependencies unused-deps: @echo "๐Ÿ” Checking for unused dependencies..." cargo machete # Run all quality checks with rule validation quality: @echo "๐Ÿ” Running all quality checks with rule validation..." @echo "๐Ÿšจ Validating Rustelo project rules..." @if ! scripts/rules/validate-rules.nu --strict; then echo "โŒ Rule validation failed!"; exit 1; fi @echo "โœ… Rule validation passed" @just format-check @just check-strict @just audit @just run