 (ns com.wsscode.pathom.parser-test
   (:require [clojure.test :refer [deftest is testing]]
             [clojure.core.async :as async :refer [go <! <!!]]
-            [com.wsscode.common.async-clj :refer [go-promise]]
+            [com.wsscode.common.async-clj :refer [let-chan go-promise]]
             [com.wsscode.pathom.parser :as pp]
             [com.wsscode.pathom.core :as p]
             [com.wsscode.pathom.connect :as pc]

                          {::pp/provides       #{:a}
                           ::pp/response-value {}})})

(defn r-async [_]
  (go :done))

(def pparser (p/parallel-parser {}))

(defn quick-reader
  ([reader] (quick-reader {} reader))
  ([env reader] (assoc env ::p/reader [p/map-reader reader])))

(defn comparable-trace [trace]
  (mapv #(dissoc % ::pt/timestamp ::pt/id) trace))

(defonce trace (atom []))

(comment
  (comparable-trace @trace))

(deftest test-parallel-parser
  (testing "returns blank channel on response"

            {:com.wsscode.pathom.core/path   []
             :com.wsscode.pathom.trace/event :com.wsscode.pathom.parser/value-return
             :key                            :a}
            {:com.wsscode.pathom.core/path       []
             :com.wsscode.pathom.trace/direction :com.wsscode.pathom.trace/leave
             :com.wsscode.pathom.trace/event     :com.wsscode.pathom.parser/parse-loop}])))
