Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Feb 6, 2017
1 parent 50cf1fb commit 0a2202e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"homepage": "https://github.com/Greentube/localize-router",
"peerDependencies": {
"@angular/core": "^2.0.0",
"@angular/common": "^2.0.0",
"@angular/http": "^2.0.0",
"@angular/router": "^3.0.0",
"rxjs": "^5.0.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/localize-router.parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {getTestBed, TestBed, fakeAsync, tick} from '@angular/core/testing';
import {Routes} from '@angular/router';
import {Observable} from 'rxjs/Observable';
import {TranslateService} from 'ng2-translate';
import {Location} from '@angular/common';
import {Location, CommonModule} from '@angular/common';

class FakeTranslateService {
defLang: string;
Expand Down Expand Up @@ -45,9 +45,10 @@ describe('LocalizeParser', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CommonModule],
providers: [
{provide: TranslateService, useClass: FakeTranslateService},
{provide: location, useClass: FakeLocation}
{provide: Location, useClass: FakeLocation}
]
});
routes = [
Expand Down
14 changes: 7 additions & 7 deletions tests/localize-router.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Injector, ApplicationRef} from '@angular/core';
import {Injector} from '@angular/core';
import {XHRBackend, HttpModule} from '@angular/http';
import {MockBackend, MockConnection} from '@angular/http/testing';
import {LocalizeRouterService} from '../src/localize-router.service';
Expand All @@ -9,7 +9,7 @@ import {Routes, Router, Event, NavigationStart, NavigationEnd} from '@angular/ro
import {Observable} from 'rxjs/Observable';
import {Subject} from 'rxjs/Subject';
import {TranslateService} from 'ng2-translate';
import { CommonModule } from '@angular/common';
import { CommonModule, Location } from '@angular/common';

class FakeTranslateService {
defLang: string;
Expand Down Expand Up @@ -40,10 +40,10 @@ class FakeRouter {
parseUrl() { return ''; }
}

class FakeApplicationRef {
componentTypes: any[];

constructor() { this.componentTypes = [DummyComponent]; }
class FakeLocation {
path():string {
return "";
}
}

class DummyComponent {}
Expand All @@ -66,7 +66,7 @@ describe('LocalizeRouterService', () => {
{provide: XHRBackend, useClass: MockBackend},
{provide: Router, useClass: FakeRouter},
{provide: TranslateService, useClass: FakeTranslateService},
{provide: ApplicationRef, useClass: FakeApplicationRef}
{provide: Location, useClass: FakeLocation}
]
});
injector = getTestBed();
Expand Down

0 comments on commit 0a2202e

Please sign in to comment.