-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
The README indicates that the three variants used below are all equivalent, but the third (shorthand) version appears not to work:
(ns example1
[lambdaisland.harvest :as h])
(h/defactory user
{:user/name "Lilliam Predovic"})
[(h/build-val user {:with {:user/name "jill"}})
(h/build-val (user :with {:user/name "jill"}))
(h/build-val (user {:user/name "jill"}))]
;; => [#:user{:name "jill"}
;; #:user{:name "jill"}
;; #:user{:name "Lilliam Predovic"}]The same issue occurs (perhaps unsurprisingly) when the call is inlined into another factory:
(ns example2
[lambdaisland.harvest :as h])
(h/defactory user
{:user/name "Lilliam Predovic"})
(h/defactory article
{:article/submitter (user {:user/name "jill"})})
(h/build-val article) ; => #:article{:submitter #:user{:name "Lilliam Predovic"}}Just my 2¢, but I'm not really convinced all these variants need to exist—and could just lead to user confusion / limit further evolution of the API—but, as described, something is amiss in either the docs or the code.
I really like what you're doing with this library! I'm still sussing out best practices, but I look forward to using Harvest to remove a bunch of boilerplate in our tests.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed