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

expound-printer #4

Closed
olivergeorge opened this issue Jul 18, 2017 · 6 comments
Closed

expound-printer #4

olivergeorge opened this issue Jul 18, 2017 · 6 comments

Comments

@olivergeorge
Copy link

olivergeorge commented Jul 18, 2017

It'd be nice to be able to bind expound-str to s/*explain-out*. With that stest/instrument should present expound formatted descriptions in exceptions.

(binding [s/*explain-out* expound/expound-printer]
    (s/explain-str (s/coll-of integer?) {:A 1}))

The main difference to the current code is that *explain-out* printers take explain-data as an arg.

@bhb
Copy link
Owner

bhb commented Jul 18, 2017

@olivergeorge Agreed! I've got a local branch where I'm working on this now.

@bhb bhb mentioned this issue Jul 21, 2017
@bhb
Copy link
Owner

bhb commented Jul 22, 2017

@olivergeorge Do you mind trying this feature before I release?

To try it:

  1. git clone git@github.com:bhb/expound.git
  2. cd expound
  3. git checkout expound-printer
  4. lein install
  5. In client project, change dep to [expound "0.1.2"]

@bhb
Copy link
Owner

bhb commented Jul 22, 2017

The output during instrumentation could be optimized for that use case, but I'll leave that for a further PR.

@bhb bhb closed this as completed in #6 Jul 25, 2017
@bhb
Copy link
Owner

bhb commented Jul 25, 2017

Thanks for reporting this!

@olivergeorge
Copy link
Author

We just tested it in on our code (cljs preload) and it's working like a charm.

@bhb
Copy link
Owner

bhb commented Jul 26, 2017

@olivergeorge I'm glad to hear that. At some point I'm going to do more work on presenting the failure in a better way (including the source code and line numbers).

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

No branches or pull requests

2 participants