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

Function TestWriteJSONFile_InvalidDir

apps/cli/internal/web/export_test.go:632–645  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

630}
631
632func TestWriteJSONFile_InvalidDir(t *testing.T) {
633 // Create a file where a directory is expected
634 tmp := t.TempDir()
635 blocker := filepath.Join(tmp, "notadir")
636 os.WriteFile(blocker, []byte("x"), 0644)
637
638 err := writeJSONFile(filepath.Join(blocker, "sub"), "test.json", "data")
639 if err == nil {
640 t.Fatal("expected error when directory path is a file")
641 }
642 if !strings.Contains(err.Error(), "failed to create directory") {
643 t.Errorf("expected 'failed to create directory' error, got: %v", err)
644 }
645}
646
647func TestFetchInterceptor_QueryParamsStripped(t *testing.T) {
648 script := fetchInterceptorScript()

Callers

nothing calls this directly

Calls 2

writeJSONFileFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected