Skip to content

bug: Ionic v7 spec file from page generated by cli: Cannot find name 'async'. #489

@jsnimda

Description

@jsnimda

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

TypeScript problems found in spec file, which is from page generated by ionic cli. It reports "Cannot find name 'async'."

Expected Behavior

No problems found

Steps to Reproduce

  1. ionic start photo-gallery tabs --type=angular --capacitor
  2. ionic g page pages/home
  3. open src/app/pages/home/home.page.spec.ts in vscode
>  beforeEach(async(() => {
              ~~~~~
>    fixture = TestBed.createComponent(HomePage);
>    component = fixture.componentInstance;
>    fixture.detectChanges();
>  }));
  1. problems found in above code

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI                     : 7.1.1 
   Ionic Framework               : @ionic/angular 7.0.7
   @angular-devkit/build-angular : 16.0.2
   @angular-devkit/schematics    : 16.0.2
   @angular/cli                  : 16.0.2
   @ionic/angular-toolkit        : 9.0.0

Capacitor:

   Capacitor CLI      : 5.0.3
   @capacitor/android : not installed
   @capacitor/core    : 5.0.3
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 1.7.2

System:

   NodeJS : v16.14.0 
   npm    : 8.3.1
   OS     : macOS Unknown

Additional Information

Ionic v6 generate page use waitForAsync instead of async.
Ionic v7 generate component also use waitForAsync
Old related changes: ionic-team/ionic-framework#22154

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