(t *testing.T)
| 630 | } |
| 631 | |
| 632 | func 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 | |
| 647 | func TestFetchInterceptor_QueryParamsStripped(t *testing.T) { |
| 648 | script := fetchInterceptorScript() |
nothing calls this directly
no test coverage detected