MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestCheckForUpdate_BadJSON

Function TestCheckForUpdate_BadJSON

internal/update/update_test.go:135–145  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

133}
134
135func TestCheckForUpdate_BadJSON(t *testing.T) {
136 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
137 w.Write([]byte("not json"))
138 }))
139 defer srv.Close()
140
141 _, err := CheckForUpdate("0.5.0", Options{ReleasesURL: srv.URL})
142 if err == nil {
143 t.Error("expected error for bad JSON")
144 }
145}
146
147func TestNormalizeVersion(t *testing.T) {
148 tests := []struct {

Callers

nothing calls this directly

Calls 1

CheckForUpdateFunction · 0.85

Tested by

no test coverage detected