Skip to content

bug: Ionic Angular schematic fails if test target options is missing an assets property #23890

@brandonroberts

Description

@brandonroberts

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

After creating an Nx workspace, running the ng add @ionic/angular command to setup Ionic for the default project fails. This is due to the test target options requiring an assets property. This property is not present in a new Nx workspace due to it using Jest instead of Karma.

Expected Behavior

The schematic completes successfully for projects not using Karma, or not using an assets property in the test target options.

Steps to Reproduce

  1. Create a new Nx workspace
npx create-nx-workspace@latest nxionic --preset angular
cd nxionic
  1. Run schematic to add Ionic
ng add @ionic/angular
  1. Note the error
✔ Package successfully installed.
"ionicNgAdd" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
Cannot read property 'push' of undefined

Code Reproduction URL

https://github.com/brandonroberts/nx-ionic-ng-add

Ionic Info

No response

Additional Information

I'll put in a PR to fix

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