mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
src-cli: Fix version output (#40928)
This commit is contained in:
parent
27f21112a9
commit
b09161cef1
@ -173,7 +173,9 @@ func (h *srcCliVersionHandler) handleDownload(w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
func (h *srcCliVersionHandler) handleVersion(w http.ResponseWriter) {
|
||||
writeJSON(w, h.Version())
|
||||
writeJSON(w, struct {
|
||||
Version string `json:"version"`
|
||||
}{Version: h.Version()})
|
||||
}
|
||||
|
||||
func isExpectedRelease(filename string) bool {
|
||||
|
||||
@ -71,7 +71,7 @@ func TestSrcCliVersionHandler_ServeHTTP(t *testing.T) {
|
||||
|
||||
handler.ServeHTTP(rec, req)
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
assert.Equal(t, "\"3.42.1\"\n", rec.Body.String())
|
||||
assert.Equal(t, `{"version":"3.42.1"}`+"\n", rec.Body.String())
|
||||
})
|
||||
|
||||
t.Run("download", func(t *testing.T) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user