Skip to content

Commit

Permalink
test: Fix elin.test-helper.message
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Feb 15, 2024
1 parent 07e28a4 commit 95491f0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/elin/test_helper/message.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(:require
[elin.protocol.rpc :as e.p.rpc]
[elin.schema.server :as e.s.server]
[elin.util.server :as e.u.server]
[malli.core :as m]))

(def ?TestMessageOption
Expand All @@ -20,20 +21,23 @@
(parse-message [_]
(condp = (first message)
;; request
0 (let [[_ id method [params]] message]
0 (let [[_ id method [params options]] message]
{:id id
:method (keyword method)
:params params})
:params params
:options (-> (e.u.server/unformat options)
;; Do not allow 'callback' option for request
(dissoc :callback))})
;; response
1 (let [[_ id error result] message]
{:id id
:error error
:result result})
;; notify
2 (let [[_ method [params callback]] message]
2 (let [[_ method [params options]] message]
{:method (keyword method)
:params params
:callback callback})
:options (e.u.server/unformat options)})
{}))) ; }}}

(m/=> test-message [:function
Expand Down

0 comments on commit 95491f0

Please sign in to comment.