Skip to content
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

ember g component creates a test with type errors #1487

Closed
1 of 21 tasks
mcfiredrill opened this issue Mar 3, 2022 · 2 comments
Closed
1 of 21 tasks

ember g component creates a test with type errors #1487

mcfiredrill opened this issue Mar 3, 2022 · 2 comments

Comments

@mcfiredrill
Copy link

mcfiredrill commented Mar 3, 2022

Which package(s) does this problem pertain to?

  • @types/ember
  • @types/ember__string
  • @types/ember__polyfills
  • @types/ember__object
  • @types/ember__utils
  • @types/ember__array
  • @types/ember__engine
  • @types/ember__debug
  • @types/ember__runloop
  • @types/ember__error
  • @types/ember__controller
  • @types/ember__component
  • @types/ember__routing
  • @types/ember__application
  • @types/ember__test
  • @types/ember__test-helpers
  • @types/ember__service
  • @types/ember-data
  • @types/rsvp
  • Other
  • I don't know

What are instructions we can follow to reproduce the issue?

ember new sample; cd ./sample # Create a new ember app
ember install ember-cli-typescript # Set up typescript support

ember g component foo

The file generated tests/integration/components/foo-test.ts has an error "Object is possibly null" on this line.
https://github.com/mcfiredrill/ember-cli-ts-test-bug/blob/main/tests/integration/components/foo-test.ts#L15

Reproduction Case

I have a repo here that reproduces the error.
https://github.com/mcfiredrill/ember-cli-ts-test-bug/blob/main/tests/integration/components/foo-test.ts#L15

@chriskrycho
Copy link
Member

Thanks for filing this! It is, unfortunately, a known issue. We're tracking the work to fix it in the existing blueprints in typed-ember/ember-cli-typescript-blueprints#240 and typed-ember/ember-cli-typescript-blueprints#75; and more importantly we're working on solving it much more holistically by way of implementing Ember RFCs: #0776: Author Built-In Blueprints in TypeScript and #0785: Introduce new test helpers for rendering (and re-rendering) that obviate the need for get and set. The combination of those will mean that we don't need the ember-cli-typescript-blueprints repo anymore and that it will be much easier to generate tests which are easy to type.

@chriskrycho
Copy link
Member

Given the above, I'm closing this, but wanted to say thank you again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants