Skip to content

Request: Add template to RenderComponentOptions #203

Closed
@lacolaco

Description

@lacolaco

https://github.com/testing-library/angular-testing-library/blob/master/projects/testing-library/src/lib/models.ts#L266

TypeScript cannot determine which Type is a component or directive. Because template is from only RenderDirectiveOptions, TypeScript language service cannot suggest it for autocompletion.

In my opinion, render(Comp, { template }) is a common use-case, and it actually works well. I'm using render(Comp, { template } for my specs to use it as a living usage documentation at same time.

it('should accept [someFlag]', async () => {
  await render(FooComponent, {
    template: `<app-foo [someFlag]="true"></app-foo>`
  })
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions