On Wednesday, May 25, 2016 at 8:28:45 PM UTC+5:45, Suren Sth wrote:
> How to mock a Javascript method during test?
> 
> I tried '(with-redefs [js/object.methodName (fn [] ...)] ...)'. Doing so I 
> get following error:
> 
> Caused by: clojure.lang.ExceptionInfo: Invalid local name: object.methodName 
> ...

The best way I have realized is to mock the object itself with 'with-redefs' 
instead of mocking a method of the object.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to