Initial commit: WYSIWYG Markdown Editor - Go backend + React/TypeScript frontend with Tailwind CSS
Backend: - Cobra CLI with --data-dir, --port, --host flags - Gin HTTP server with REST API for markdown CRUD operations - File storage on disk (.md files only) - Comprehensive logrus logging - Backend tests with CRUD round-trip verification Frontend: - React 18 + TypeScript + Tailwind CSS - Markdown editor with live GFM preview (react-markdown + remark-gfm) - File management UI (list, create, open, save, delete) - Theme switcher with Dark/Light/System modes - Responsive design - Frontend tests with vitest Testing: - All backend tests pass (go test ./...) - All frontend tests pass (npm test)
This commit is contained in:
26
cmd/main_test.go
Normal file
26
cmd/main_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestExecute(t *testing.T) {
|
||||
// Just verify the command structure
|
||||
cmd := rootCmd
|
||||
if cmd == nil {
|
||||
t.Error("rootCmd is nil")
|
||||
}
|
||||
if cmd.Use != "markdown-editor" {
|
||||
t.Errorf("Expected Use 'markdown-editor', got '%s'", cmd.Use)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunServer(t *testing.T) {
|
||||
cmd := rootCmd
|
||||
if cmd == nil {
|
||||
t.Error("rootCmd is nil")
|
||||
}
|
||||
if cmd.Use != "markdown-editor" {
|
||||
t.Errorf("Expected Use 'markdown-editor', got '%s'", cmd.Use)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user