Skip to content

bug: ionic angular, karma tests not waiting for ionic to load on live-reloads #22853

@bohndthi

Description

@bohndthi

Bug Report

Ionic version:
[x] 5.x

Current behavior:
If a page contains an ion-segment, the karma tests throws an long error message:

Chrome Headless 88.0.4324.50 (Linux x86_64): Executed 2 of 111 (1 FAILED) (0 secs / 0.339 secs)
ERROR: TypeError: config.get is not a function
TypeError: config.get is not a function
    at addEventListener (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@ionic/core/dist/esm/helpers-90f46169.js:29:1)
    at SegmentButton.connectedCallback (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@ionic/core/dist/esm/ion-segment_2.entry.js:375:23)
    at safeCall (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@ionic/core/dist/esm/index-e806d1f6.js:1261:1)
    at fireConnectedCallback (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@ionic/core/dist/esm/index-e806d1f6.js:1687:1)
    at initializeComponent (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@ionic/core/dist/esm/index-e806d1f6.js:1650:1)
    at http://localhost:9876/_karma_webpack_/webpack:/node_modules/@ionic/core/dist/esm/index-e806d1f6.js:1750:1
    at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone-evergreen.js:368:1)
    at ProxyZoneSpec.push.QpwO.ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone-testing.js:300:1)
    at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone-evergreen.js:367:1)

Expected behavior:
no long error messages
Steps to reproduce:

  • Create new project (angular)
  • add an ion-segment to a page
  • run the karma unit test for the page

Ionic info:

@ionic/angular: 5.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions