Skip to content

ERROR: 'Error during cleanup of component' #51

@notbenj

Description

@notbenj

Hello,

I'm trying to use MenuControllerMock like so in my component test:

import {MenuControllerMock} from 'ionic-mocks';

providers: [{provide: MenuController, useFactory: () => MenuControllerMock.instance()}]

I get this error in the console:

ERROR: 'Error during cleanup of component'

I found out that if I add the _unregister() method in the mock (ionic-mocks/dist/angular/menu-controller.js), the error disappears:

var instance = jasmine.createSpyObj('MenuController', ['close', 'enable', 'get', 'getMenus', 'getOpen', 'isEnabled', 'isOpen', 'open', 'swipeEnable', 'toggle', '_unregister']);

instance._unregister.and.returnValue(true);

I cannot imagine you've never encountered my issue, so I'm thinking I missed something.

Do you have any idea why I get this error during cleanup of the component?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions