-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add type-tests #153
base: main
Are you sure you want to change the base?
Add type-tests #153
Conversation
8f1e251
to
e280e7a
Compare
387847b
to
5d2aae9
Compare
a6fc51f
to
7b3f383
Compare
7b3f383
to
f9c6aac
Compare
If active members of the TS team have other opinions I'll happily defer to them, but my general take is that a typical TS addon shouldn't need type tests. In my experience, dedicated type tests are useful in two scenarios:
For an addon authored in TypeScript, neither of these situations will usually apply, and I think it's generally going to be more productive to treat your actual runtime tests as effectively being end-to-end tests of your types. Having good examples to point to for cases where authors do need type tests is great! But I don't think those cases are likely common enough that we should bake support into the default blueprint. |
I am curious, seems this is contrary to what Dan said above. Do you have examples for these type-tests in real addons? |
ember-resources, ember-modifier, @ember/test-helpers, ember-async-data, ember-qunit, and ember-source (off the top of my head)
I think so, they each do goofy types-related things for various reasons.
Well, recommend for all and recommend for those that need them is probably the difference here. |
Resolves #142 (<- also context)
Requires: #158
type-tests have become a pattern in TS-using v1 and v2 addons to help ensure that APIs maintain consistent and expected typings across TS upgrades.
the typed-ember team has recommended this approach on other v2 addons, and it is in used in ember-source.