Closed malcolmredheron closed 1 year ago
Yes, you're right, it would be better, thankfully it can be changed by the user. If you make a PR I'll merge it and release, otherwise I'll do it at some point when I make the next release.
Great! I have a fork of your repo that includes separate branches for several changes that I made, including this one. But I see now that I accidentally included in each of my branches a change that enables me to use a github branch in my fork directly from npm (without building it and pushing it to npmjs.com). I've sent you a PR for that. If you want it, then I'll keep my other branches as they are and can send you a PR for this and a few others. If you don't want it then I'll clean up my branches first.
fixed by the PR
Is it intentional that preludeTsContractViolationCb (https://github.com/emmanueltouzery/prelude-ts/blob/736e40c9dcea6a3179daf1db52152159e0ab7236/src/Contract.ts#L4) throws a string instead of an exception?
In my setup (with Mocha), when a test throws a string I don't get a stack trace. When it throws an exception, I do. Thus, running
setContractViolationAction((message) => { throw new Error(message); });
before tests makes for much nicer errors.But if you don't have objections, I think that it would be great to just change preludeTsContractViolationCb to do this by default.