Skip to content

Override imports of routed standalone component #396

Closed
@Nosfistis

Description

@Nosfistis

I am having the case of a routed component that requires some resolved data. The component itself has some imports that require stubbing. In the pre-standalone era this was done easily via imports. With standalone it should be done via componentImports. However, componentImports does not override routed component imports, only the rendered component's imports.

await render(MyComponent, {
  componentImports: [FontAwesomeTestingModule],
  declarations: [StubSelectComponent],
  initialRoute: '',
  routes: [
    { path: '', component: MyComponent, resolve: { page: () => requestPageData() } },
  ],
});

Now, I know that this is flawed, but I am trying to achieve a truly routed component whose imports are stubbed.

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