Permalink
Browse files

test(): fix tests

  • Loading branch information...
1 parent 2475265 commit 0388ac3f6b41937da977b75a36dbafb7f2d62cb5 @ihadeed ihadeed committed Oct 27, 2016
Showing with 2 additions and 29 deletions.
  1. +1 −0 karma.conf.ts
  2. +1 −1 test/plugin.spec.ts
  3. +0 −28 test/plugins/mixpanel.spec.ts
View
@@ -22,6 +22,7 @@ module.exports = config => {
},
browserify: {
+ debug: true,
plugin: [ 'tsify' ],
extensions: ['.js', '.ts']
},
View
@@ -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: {}
};
@@ -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();
- });
-
-});

0 comments on commit 0388ac3

Please sign in to comment.