Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support async tests #75

Open
akiroz opened this issue Jun 5, 2017 · 2 comments
Open

Support async tests #75

akiroz opened this issue Jun 5, 2017 · 2 comments

Comments

@akiroz
Copy link

akiroz commented Jun 5, 2017

CLJS code is often async, maybe provide a =async=> that expects a checker on the RHS with a callback passed in?

@ragnorak1000
Copy link
Collaborator

Do you have an example in mind that you would like to see work?

@akiroz
Copy link
Author

akiroz commented Jun 5, 2017

I was actually thinking of something like this:

(defn fetch-foo []
  (.resolve js/Promise :foo))

(defn promise-of [thing]
  (fn [result done]
    (-> result
        (.then #(= % thing))
        (.then done))))

(fact "Can fetch foo asynchronously"
  (fetch-foo) =async=> (promise-of :foo))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants