Commit 0a1968f0dc0d2314292fceedecba6cdf36d81d85
1 parent
97702802
Exists in
master
and in
34 other branches
changed helpers
Showing
1 changed file
with
8 additions
and
6 deletions
Show diff stats
src/spec/helpers.ts
| ... | ... | @@ -62,10 +62,10 @@ class AngularServiceHookComponent { |
| 62 | 62 | |
| 63 | 63 | class AngularServiceFactory { |
| 64 | 64 | fixtureComponentHookPoint: ComponentFixture; |
| 65 | - tcb: TestComponentBuilder = new TestComponentBuilder(); | |
| 65 | + // tcb: TestComponentBuilder = new TestComponentBuilder(); | |
| 66 | 66 | |
| 67 | 67 | constructor() { |
| 68 | - this.fixtureComponentHookPoint = (<any>this.tcb)["create"](AngularServiceHookComponent); | |
| 68 | + this.fixtureComponentHookPoint = (<any>tcb)["create"](AngularServiceHookComponent); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | getAngularService<T>(angularService: string) { |
| ... | ... | @@ -81,21 +81,23 @@ class AngularServiceFactory { |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | -export var angularServiceFactory = new AngularServiceFactory(); | |
| 84 | +export function getAngularServiceFactory() { | |
| 85 | + return new AngularServiceFactory(); | |
| 86 | +} | |
| 85 | 87 | /** |
| 86 | 88 | * This help function allows get angular services to be used in integration tests |
| 87 | 89 | * i.e: '$http', '$q', '$location', etc... |
| 88 | 90 | */ |
| 89 | 91 | export function getAngularService<T>(angularService: string) { |
| 90 | - return angularServiceFactory.getAngularService(angularService); | |
| 92 | + return getAngularServiceFactory().getAngularService(angularService); | |
| 91 | 93 | } |
| 92 | 94 | |
| 93 | 95 | export function getQService(): ng.IQService { |
| 94 | - return angularServiceFactory.getQService(); | |
| 96 | + return getAngularServiceFactory().getQService(); | |
| 95 | 97 | } |
| 96 | 98 | |
| 97 | 99 | export function getHttpBackendService(): ng.IHttpBackendService { |
| 98 | - return angularServiceFactory.getHttpBackendService(); | |
| 100 | + return getAngularServiceFactory().getHttpBackendService(); | |
| 99 | 101 | } |
| 100 | 102 | |
| 101 | 103 | // export function getResolvablePromise() { | ... | ... |