Ionic2: Including Ionic Push breaks E2E testing

Viewed 62

I have a strange situation where if I include Ionic's Push in my app.module.ts, none of my E2E tests will run. The test fails to start with a timeout error. It would appear as though somehow Push is preventing browser.waitForAngular() from returning.

Example 1 - E2E does not work:

import {CloudModule, CloudSettings, Push} from "@ionic/cloud-angular";

@NgModule({
    providers: [
        // my other providers ...
        { provide: MyPushService, useClass: MyPushService, deps: [Push] }
    ]

Example 2 - Add a mock class, E2E does work:

import {CloudModule, CloudSettings, Push} from "@ionic/cloud-angular";

@NgModule({
    providers: [
        // my other providers ...
        { provide: Push, useClass: PushMock},
        { provide: MyPushService, useClass: MyPushService, deps: [Push] }
    ]

I've been looking through the push.js source hoping to find a setTimeout, setInterval or something similar that might make angular think it's waiting for something but I can't see anything.

Any help is much appreciated.

1 Answers
Related