-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Stub out the @App decorator provided by Ionic | ||
// This allows us to test app.ts (thus providing a full coverage report as app.ts must include everything) | ||
// which otherwise blows up in the browser on "ion-app selector cannot be found" | ||
// | ||
// https://www.sitepen.com/blog/2015/10/20/typescript-decorators/ | ||
// | ||
export function App<TFunction extends Function>(target: TFunction): TFunction { | ||
let newConstructor = function () { | ||
// no-op | ||
}; | ||
|
||
return <any> newConstructor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
export class TestUtils { | ||
|
||
// http://stackoverflow.com/questions/2705583/how-to-simulate-a-click-with-javascript | ||
public static eventFire(el: any, etype: string): void { | ||
if (el.fireEvent) { | ||
el.fireEvent('on' + etype); | ||
} else { | ||
let evObj: any = document.createEvent('Events'); | ||
evObj.initEvent(etype, true, false); | ||
el.dispatchEvent(evObj); | ||
} | ||
} | ||
} |