Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: 'Error during cleanup of component' #51

Open
notbenj opened this issue Apr 11, 2018 · 0 comments
Open

ERROR: 'Error during cleanup of component' #51

notbenj opened this issue Apr 11, 2018 · 0 comments

Comments

@notbenj
Copy link

notbenj commented Apr 11, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant