Ionic 4 + angular 8 test failure

I ran into this same problem.

I had expected to be able to mock the platform directly with code like this:

    platformSpy = jasmine.createSpyObj('Platform', {
      ready: platformReadySpy,
      backButton: mockBackButton,
    });

but Jasmine.createSpyObj creates a function for the backButton instead of assigning it to my mockBackButton instance.

I created my own MockPlatform instead:

class MockPlatform {
  ready: jasmine.Spy<any>;
  backButton: any;
}

and then I could instantiate the mock Platform with this code:

    mockPlatform = new MockPlatform();
    mockPlatform.ready = platformReadySpy;
    mockPlatform.backButton = mockBackButton;

Hope this helps.