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

Super.apply is not a function (social-sharing-mock) #26

Open
nathantaal opened this issue Nov 30, 2018 · 7 comments
Open

Super.apply is not a function (social-sharing-mock) #26

nathantaal opened this issue Nov 30, 2018 · 7 comments

Comments

@nathantaal
Copy link

nathantaal commented Nov 30, 2018

I get the following error when running an unit test:

TypeError: _super.apply is not a function
	    at new SocialSharingMock (http://localhost:9876/node_modules/@ionic-native-mocks/social-sharing/index.js?:15:1)
	    at _createClass (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:8412:1)
	    at _createProviderInstance (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:8386:1)
	    at resolveNgModuleDep (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:8349:1)
	    at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:9057:1)
	    at resolveDep (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:9422:1)
	    at createClass (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:9296:1)
	    at createDirectiveInstance (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:9179:1)
	    at createViewNodes (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:10399:1)
	    at createRootView (http://localhost:9876/node_modules/@angular/core/fesm5/core.js?:10313:1)
	Expected undefined to be truthy.
	    at UserContext.<anonymous> (http://localhost:9876/src/app/pages/bg/contact/contact.page.spec.ts?:31:27)
	    at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/node_modules/zone.js/dist/zone.js?:388:1)
	    at ProxyZoneSpec.push../node_modules/zone.js/dist/zone-testing.js.ProxyZoneSpec.onInvoke (http://localhost:9876/node_modules/zone.js/dist/zone-testing.js?:288:1)
	    at ZoneDelegate../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/node_modules/zone.js/dist/zone.js?:387:1)

is the mock missing an function or is there something else happening?

@nathantaal nathantaal reopened this Nov 30, 2018
@nathantaal nathantaal changed the title Support for Ionic 4? Super.apply is not a function (social-sharing-mock) Nov 30, 2018
@nathantaal
Copy link
Author

So when opening social-sharing/index.js it imports { SocialSharing } from '@ionic-native/social-sharing'
When I change that import to { SocialSharing } from '@ionic-native/social-sharing/ngx' the tests pass.
This is because Ionic 4, any support plannend for it?

@chrisgriffith
Copy link
Owner

Yes. I am waiting on the dust to settle before I embark on the updates (and finish my Ionic 4 book).

@nathantaal
Copy link
Author

Let me know if and when you have more info on that book :)

@chrisgriffith
Copy link
Owner

http://ionic-book.com/ :)

@cpyle0819
Copy link

Getting this issue with the push mock. Any update on this?

@blahblehblah
Copy link

Any update? most of the plugins are acting the same with
_super.apply is not a function

@chrisgriffith
Copy link
Owner

Unfortunately, I have not been working on this. Maybe during this quarantine I can devote some time to fully fixing it to use Ionic Native v5

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

4 participants