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

Function TestSyncCommand_MissingConfig

apps/cli/internal/cli/sync_test.go:12–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestSyncCommand_MissingConfig(t *testing.T) {
13 syncDryRun = false
14 syncSource = ""
15
16 tmpDir := t.TempDir()
17 origDir, _ := os.Getwd()
18 if err := os.Chdir(tmpDir); err != nil {
19 t.Fatal(err)
20 }
21 defer os.Chdir(origDir)
22
23 err := runSync(syncDownCmd, nil)
24 if err == nil {
25 t.Fatal("expected error when config is missing")
26 }
27 if !strings.Contains(err.Error(), ".taskmd.yaml") {
28 t.Errorf("unexpected error message: %v", err)
29 }
30}
31
32func TestSyncCommand_DryRun(t *testing.T) {
33 sourceName := "test-cli-dryrun"

Callers

nothing calls this directly

Calls 2

runSyncFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected