Comments (1)
While I understand your POV, this is strictly not a regression, it's an intentional change in the type to match the actual behavior. There is no way for find()
to actually provide something of that type, so we are not going to ship a type definition which pretends it does.
While folks often use generics/type params like this as a convenient way to do a cast, there's a very good reason that most ESLint (and historically also TSLint!) rule sets forbid generic types which constrain the return type without any relation to an input parameter. That reason is: it is literally always a lie for a generic to appear on a call expression like this other than a constructor type (where it is narrowing what you can do with the returned type from an otherwise unconstrained default). Net: this was always an inappropriate use of a generic parameter.
To be clear: I understand why you might find the decrease in convenience annoying, especially in tests. But it's not a regression, and we're not going to revert it.
(And no, shipping something stronger than TS does is not necessarily "overly opinionated": TS has to balance not breaking every single piece of DOM code using TS out there against correctness, and they might well make different decisions today if starting from scratch!)
from ember-test-helpers.
Related Issues (20)
- Support for `rerender()` with DOM interaction helpers in acceptance tests HOT 2
- triggerEvent for a "change" event for a file input does not set the value of the input correctly HOT 1
- [DOCS] Documentaiton for tab helper has not been published HOT 1
- ember-try embroider-safe fails on CI HOT 2
- Convert to TS or supply ambient definitions HOT 4
- Let's add fetch to the settled checks? HOT 2
- Missing types for @glimmer/interfaces HOT 3
- element doesn't exist on type TestContext HOT 2
- Property 'element' does not exist on type 'TestContext'. ? HOT 2
- `find` and `findAll` examples are swapped
- Cannot find type definition file for 'ember__test-helpers' after upgrading to v2.9.3 HOT 2
- Rethinking helpers for forms input HOT 2
- Observers not triggered in ember acceptance tests
- [proposal] add hooks support to all dom helpers + settled and wait-until
- Upgrade `registerHook` and `runHooks` as official public APIs HOT 4
- `fillIn` does not work with input values that are decorated with the `readonly` helper HOT 1
- [feature request] pass more information back in error scenarios
- `scrollTo` target type inconsistent with other test helpers
- Setup context fails when using ember-data v4 and a custom resolver
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-test-helpers.