Closed kpturner closed 3 years ago
I keep struggling with this as well... Is there any news on it?
Apparently fixed - see comments above yours
@kpturner Fixed in an open pull request - that is not too helpful for me tbh...
Will the PR be integrated and a new version be released at some point?
I’ve no idea - it’s not my project. Try adding a comment to the PR to prompt the author to merge it or PM them directly.
Why do you close the issue then if it is not fixed?
Because there is no point in having two issues open for the same thing.
I will leave it open if you want to pursue it here rather than on the #76
For me a PR is not an issue, so in my own projects I prefer to track the issues. But I can understand your decision as well. So, feel free :-) I will move my comment over to the PR if you close this one.
Thank you all for your help and attention! I've merged the tweak from @kpturner in and will release a new version shortly!
Btw, if any of you have seen someone write automated tests for TypeScript typings, please let me know! I'd love to ensure the typings remain correct.
If you write some TypeScript code that uses js-must (i.e. some example tests written in TypeScript) and that is properly annotated with types, then the compiler will already flag any violations -- no need to run tests for this.
(Or am I misunderstanding what you're aiming at?)
EDIT: Most cases will probably even work sufficiently without type annotations. So you could in principle just use a demonstrator test suite for js-must and run it through the TypeScript compiler.
I was thinking of a [test] file with a few well-typed uses per Must.js's assertion method and some ill-typed uses. Then running it through the typechecker along with other tests. :) I imagine the well-typed case is easy — running tsc --check
or the equivalent and asserting it exits with 0
. Testing for ill-typed uses probably won't be that easy. Dunno if it's actually worth the trouble to achieve though.
Testing for ill-typed uses probably won't be that easy. Dunno if it's actually worth the trouble to achieve though.
I was actually wondering about that one as well...
I (as a user) am more interested in being assured that js-must does not violate my TypeScript settings with its typings (e.g. no usage of "any") to be honest. So if your tests check for the well-typed stuff (with the TypeScript compiler settings being set to the strictest possible options), that would already be super-amazing!
In
must.d.ts
shouldn't this:declare function must(expected: any): Must;
actually be this:
declare function must(expected: any, msg?: string): Must;
otherwise how do we call must with the optional message parameter in Typescript?