MCPcopy Create free account
hub / github.com/driangle/taskmd / TestNewServer_CreatesInstance

Function TestNewServer_CreatesInstance

apps/cli/internal/web/server_test.go:74–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

72}
73
74func TestNewServer_CreatesInstance(t *testing.T) {
75 dir := createTestTaskDir(t)
76 cfg := Config{
77 Port: 0,
78 ScanDir: dir,
79 Dev: false,
80 Verbose: false,
81 }
82
83 s := NewServer(cfg)
84
85 if s == nil {
86 t.Fatal("expected non-nil server")
87 return
88 }
89 if s.dp == nil {
90 t.Error("expected non-nil data provider")
91 }
92 if s.broker == nil {
93 t.Error("expected non-nil SSE broker")
94 }
95 if s.watcher == nil {
96 t.Error("expected non-nil watcher")
97 }
98 if s.config.ScanDir != dir {
99 t.Errorf("expected scan dir %q, got %q", dir, s.config.ScanDir)
100 }
101}
102
103func TestNewServer_DevMode(t *testing.T) {
104 dir := createTestTaskDir(t)

Callers

nothing calls this directly

Calls 3

createTestTaskDirFunction · 0.85
ErrorMethod · 0.80
NewServerFunction · 0.70

Tested by

no test coverage detected