(t *testing.T)
| 103 | } |
| 104 | |
| 105 | func TestReadTokensReturnsUnmarshalError(t *testing.T) { |
| 106 | authFile := filepath.Join(t.TempDir(), "auth.json") |
| 107 | if err := os.WriteFile(authFile, []byte(`not-json`), 0600); err != nil { |
| 108 | t.Fatal(err) |
| 109 | } |
| 110 | |
| 111 | if _, err := readTokens(authFile); err == nil { |
| 112 | t.Fatal("expected invalid JSON to return an error") |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func TestWriteTokensCreatesParentDirectory(t *testing.T) { |
| 117 | authFile := filepath.Join(t.TempDir(), "nested", "auth.json") |
nothing calls this directly
no test coverage detected