ember-cli-typescript icon indicating copy to clipboard operation
ember-cli-typescript copied to clipboard

Type for TestContext is in an odd location

Open chriskrycho opened this issue 5 years ago • 3 comments

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.

chriskrycho avatar Nov 21 '19 15:11 chriskrycho

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';

kpfefferle avatar Dec 16 '20 20:12 kpfefferle

This been done yet?

runspired avatar May 19 '21 19:05 runspired

Nope! I'd gladly review a PR on DT though!

chriskrycho avatar May 20 '21 11:05 chriskrycho

This has been fixed long since, in both the DT types (for Ember v4) and in @ember/test-helpers's own types.

chriskrycho avatar Sep 28 '23 23:09 chriskrycho