You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for another great library! It really makes it easy to combine the validation of types with my current jest setup.
There's one question I have. In my tests, I need to check that my type inference is working correctly for an instance of a class I created. In my DTSLint tests, I created several something similar to the following.
We currently do not support exact type testing and I think it may be hard to use since the type display is not stable (microsoft/TypeScript#17944).
If all of your tests are passed in dtslint, it should be fine to just replace those $ExpectType with @dts-jest:snap and run the tests. If you'd like to check the correctness, you could generate diff-friendly snapshots and replace @dts-jest:snap -> with $ExpectType in snapshots, the output should be exact the same as your dtslint test files.
Thanks very much for this package, I haven't found anything like it before and I really needed it.
I would also like to make type assertions. I'm using dts-jest-remap now as suggested above for easier manual checks, but it still feels a bit clunky. It doesn't allow for TDD with utility types because you have to generate snapshots first and check the outputs until you have what you intended. I'd really love to assert types up front, then work on the type until it passes. The syntax could work similar to how the diff snap is generated:
// @dts-jest -> { a: any }typex=Required<{a?: any}>
I get that type display may not be stable from one TS version to the next, but for my project I'd be wiling to maintain that as it changes and it might even help me to surface those changes when I update TS.
Thanks for another great library! It really makes it easy to combine the validation of types with my current jest setup.
There's one question I have. In my tests, I need to check that my type inference is working correctly for an instance of a class I created. In my DTSLint tests, I created several something similar to the following.
Is it currently possible to port over the above tests from DTSLint? Does this library provide a way of testing the exact value of types?
The text was updated successfully, but these errors were encountered: