ember-cli-typescript
ember-cli-typescript copied to clipboard
Type for TestContext is in an odd location
Which package(s) does this enhancement pertain to?
- [x] @types/ember__test-helpers
Please write a user story for this feature
As a developer writing tests in Ember, I want the import for TestContext to make sense so that it matches the rest of my imports.
We published the types for QUnit's test helpers during the transition to the new approach, and ended up with the type import for TestContext in ember-test-helpers. However, no one should actually be using ember-test-helpers for most imports, and it's almost certainly not what we want to have a direct interface import from the root of @ember/test-helpers when there is no such export from the package proper.
This issue may gain new relevance now as ember-qunit v5 migration recommends moving away from ember-test-helpers.
@ember/test-helpers/setup-context defines a TestContext export - maybe we can make that available via @types/ember__test-helpers?
// Example
import { TestContext } from '@ember/test-helpers/setup-context';
This been done yet?
Nope! I'd gladly review a PR on DT though!
This has been fixed long since, in both the DT types (for Ember v4) and in @ember/test-helpers's own types.