- Build Go backend with Cobra CLI and REST API - CRUD operations for markdown files (GET, POST, PUT, DELETE) - File storage with flat .md file structure - Comprehensive logrus logging with JSON format - Static asset serving for frontend - Build React/TypeScript frontend with Tailwind CSS - Markdown editor with live GFM preview - File management UI (list, create, open, delete) - Theme system (Dark/Light/System) with persistence - Responsive design (320px mobile, 1920px desktop) - Add comprehensive test coverage - Backend: API, storage, and logger tests (13 tests passing) - Frontend: Editor and App component tests - Setup Nix development environment with Go, Node.js, and TypeScript
34 lines
641 B
Bash
Executable File
34 lines
641 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Create temporary directory for test data
|
|
TEST_DIR=$(mktemp -d)
|
|
echo "Test directory: $TEST_DIR"
|
|
|
|
# Test file storage
|
|
echo "Testing file storage..."
|
|
|
|
# Create test files
|
|
echo "# Test Heading" > "$TEST_DIR/test1.md"
|
|
echo "# Another Test" > "$TEST_DIR/test2.md"
|
|
|
|
# List files
|
|
ls "$TEST_DIR"/*.md
|
|
|
|
# Read file
|
|
CONTENT=$(cat "$TEST_DIR/test1.md")
|
|
echo "File content: $CONTENT"
|
|
|
|
# Delete file
|
|
rm "$TEST_DIR/test1.md"
|
|
|
|
# Check if file was deleted
|
|
if [ -f "$TEST_DIR/test1.md" ]; then
|
|
echo "ERROR: File was not deleted"
|
|
else
|
|
echo "SUCCESS: File was deleted"
|
|
fi
|
|
|
|
# Cleanup
|
|
rm -rf "$TEST_DIR"
|
|
echo "Test completed successfully"
|