Skip to content

ember g component creates a test with type errors #1487

Closed
@mcfiredrill

Description

@mcfiredrill

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions