# Karma test setup on latest ionic-native / ng2

**URL:** <https://forum.ionicframework.com/t/karma-test-setup-on-latest-ionic-native-ng2/69577>\
**Category:** ionic-v3\
**Created:** [November 8, 2016, 3:34pm UTC](https://forum.ionicframework.com/t/karma-test-setup-on-latest-ionic-native-ng2/69577 "2016-11-08T15:34:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgmanh](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@jgmanh](https://forum.ionicframework.com/u/jgmanh)\
**Post date:** [November 8, 2016, 3:34pm UTC](https://forum.ionicframework.com/t/karma-test-setup-on-latest-ionic-native-ng2/69577/1 "2016-11-08T15:34:32Z")

</div>

Hi everyone,

I’m having trouble setting up Karma to work with latest ionic-native and ng2 libs. After correctly (?) setting up karma using the numerous forum and stackoverflow posts, the proxy to ionic-native works fine, but then it complains of:

```
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/ng1.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/actionsheet.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/android-fingerprint-auth.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/appavailability.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/apprate.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/admob.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/ng1.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/actionsheet.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/android-fingerprint-auth.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/appavailability.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/apprate.js (socket hang up)
WARN [proxy]: failed to proxy ./node_modules/ionic-native/dist/plugins/admob.js (socket hang up)

```

And then a final failure with this:  
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR  
{  
“stack”: “(SystemJS) XHR error loading node\_modules/ionic-native/dist/ng1.js\n\tError loading node\_modules/ionic-native/dist/ng1.js as “./ng1” from node\_modules/ionic-native/dist/ionic.native.js”,  
“originalErr”: {},  
“line”: 791,  
“sourceURL”: “node\_modules/systemjs/dist/system.src.js”  
}

08 11 2016 10:24:18.510:ERROR [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: { stack: ‘(SystemJS) XHR error loading [http://localhost:9876/base/node\_modules/ionic-native/dist/ng1.js\n\tError](http://localhost:9876/base/node_modules/ionic-native/dist/ng1.js%5Cn%5CtError) loading [http://localhost:9876/base/node\_modules/ionic-native/dist/ng1.js](http://localhost:9876/base/node_modules/ionic-native/dist/ng1.js) as “./ng1” from [http://localhost:9876/base/node\_modules/ionic-native/dist/ionic.native.js](http://localhost:9876/base/node_modules/ionic-native/dist/ionic.native.js)’,  
originalErr: {},  
line: 791,  
sourceURL: ‘[http://localhost:9876/base/node\_modules/systemjs/dist/system.src.js?3ff30a454997746a9b3130d627eb0d7441f0fc52](http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?3ff30a454997746a9b3130d627eb0d7441f0fc52)’ }

As you can notice, is looks for dist/ng1.js, but the ng1 only exists in either es5 or esm. I also gave directly proxy to es5, but then the same error in a different fashion. I just cannot figure out what is wrong here and I’ve done a lot of searches and trial/error to get this working.

Does anyone here know what could be wrong or what should I do to make it work?

Thanks,  
Jay
