mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 03:20:11 +00:00
chore(test): fix test asset dependencies
- Add ensure_test_assets.sh script to generate dummy frontend assets for testing - Update Makefile to run asset generation before tests
This commit is contained in:
parent
347a2572da
commit
36ff16cd85
2 changed files with 25 additions and 0 deletions
1
Makefile
1
Makefile
|
|
@ -70,6 +70,7 @@ format-frontend:
|
|||
npm --prefix $(FRONTEND_DIR) run format
|
||||
|
||||
test:
|
||||
@./scripts/ensure_test_assets.sh
|
||||
@echo "Running backend tests (excluding tmp tooling)..."
|
||||
go test $$(go list ./... | grep -v '/tmp$$')
|
||||
|
||||
|
|
|
|||
24
scripts/ensure_test_assets.sh
Executable file
24
scripts/ensure_test_assets.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
# scripts/ensure_test_assets.sh
|
||||
# Ensures that frontend assets exist for Go embed requirements during testing.
|
||||
|
||||
ASSET_DIR="internal/api/frontend-modern/dist"
|
||||
INDEX_FILE="$ASSET_DIR/index.html"
|
||||
|
||||
# If directory doesn't exist, create it
|
||||
if [ ! -d "$ASSET_DIR" ]; then
|
||||
echo "Test assets missing. Creating dummy frontend assets in $ASSET_DIR..."
|
||||
mkdir -p "$ASSET_DIR"
|
||||
fi
|
||||
|
||||
# If index.html doesn't exist, create a dummy one
|
||||
if [ ! -f "$INDEX_FILE" ]; then
|
||||
echo "Creating dummy index.html for testing..."
|
||||
cat > "$INDEX_FILE" <<EOF
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><title>Test Asset</title></head>
|
||||
<body><h1>Pulse Test Asset</h1></body>
|
||||
</html>
|
||||
EOF
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue