diff --git a/karma.conf.ts b/karma.conf.ts index da215d038..5b3106254 100644 --- a/karma.conf.ts +++ b/karma.conf.ts @@ -22,6 +22,7 @@ module.exports = config => { }, browserify: { + debug: true, plugin: [ 'tsify' ], extensions: ['.js', '.ts'] }, diff --git a/test/plugin.spec.ts b/test/plugin.spec.ts index 8109e5cf2..ecdb07a74 100644 --- a/test/plugin.spec.ts +++ b/test/plugin.spec.ts @@ -3,7 +3,7 @@ import 'es6-shim'; import {Plugin, Cordova} from './../src/plugins/plugin'; -declare const window: any; +declare let window: any; window.plugins = { test: {} }; diff --git a/test/plugins/mixpanel.spec.ts b/test/plugins/mixpanel.spec.ts deleted file mode 100644 index 7eb43d0b4..000000000 --- a/test/plugins/mixpanel.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {Mixpanel} from '../../src/plugins/mixpanel'; -declare const window: any; - -window.mixpanel = { - people: { - identify: (args, success, error) => success('Success') - } -}; - -describe('Mixpanel', () => { - - it('should return MixpanelPeople', () => { - expect(Mixpanel.people).toBeDefined(); - expect(Mixpanel.people.identify).toBeDefined(); - }); - - it('should call a method of MixpanelPeople', (done) => { - const spy = spyOn(window.mixpanel.people, 'identify').and.callThrough(); - Mixpanel.people.identify('veryDistinctSuchIdVeryWow') - .then(result => { - expect(result).toEqual('Success'); - done(); - }); - expect(spy.calls.mostRecent().args[0]).toEqual('veryDistinctSuchIdVeryWow'); - expect(window.mixpanel.people.identify).toHaveBeenCalled(); - }); - -});