Skip to content

Commit de5c5d0

Browse files
chore(lint): lint ulrRouterSpec
1 parent 5a526ce commit de5c5d0

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

test/urlRouterSpec.ts

+20-20
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { StateRegistry } from "../src/state/stateRegistry";
66
import { noop } from "../src/common/common";
77
import { UrlRule, MatchResult } from "../src/url/interface";
88

9-
declare var jasmine;
10-
var _anything = jasmine.anything();
9+
declare let jasmine;
10+
let _anything = jasmine.anything();
1111

1212
describe("UrlRouter", function () {
13-
var router: UIRouter;
14-
var urlRouter: UrlRouter,
13+
let router: UIRouter;
14+
let urlRouter: UrlRouter,
1515
urlService: UrlService,
1616
urlMatcherFactory: UrlMatcherFactory,
1717
stateService: StateService,
@@ -62,8 +62,8 @@ describe("UrlRouter", function () {
6262
});
6363

6464
it('`rule` should return a deregistration function', function() {
65-
var count = 0;
66-
var rule: UrlRule = {
65+
let count = 0;
66+
let rule: UrlRule = {
6767
match: () => count++,
6868
handler: match => match,
6969
matchPriority: () => 0,
@@ -85,8 +85,8 @@ describe("UrlRouter", function () {
8585
});
8686

8787
it('`removeRule` should remove a previously registered rule', function() {
88-
var count = 0;
89-
var rule: UrlRule = {
88+
let count = 0;
89+
let rule: UrlRule = {
9090
match: () => count++,
9191
handler: match => match,
9292
matchPriority: () => 0,
@@ -161,7 +161,7 @@ describe("UrlRouter", function () {
161161
describe("URL generation", function() {
162162
it("should return null when UrlMatcher rejects parameters", function () {
163163
urlMatcherFactory.type("custom", <any> { is: val => val === 1138 });
164-
var urlmatcher = matcher("/foo/{param:custom}");
164+
let urlmatcher = matcher("/foo/{param:custom}");
165165

166166
expect(urlRouter.href(urlmatcher, { param: 1138 })).toBe('#/foo/1138');
167167
expect(urlRouter.href(urlmatcher, { param: 5 })).toBeNull();
@@ -174,12 +174,12 @@ describe("UrlRouter", function () {
174174

175175
describe('Url Rule priority', () => {
176176

177-
var matchlog: string[];
177+
let matchlog: string[];
178178
beforeEach(() => matchlog = []);
179179
const log = (id) => () => (matchlog.push(id), null);
180180

181181
it("should prioritize a path with a static string over a param 1", () => {
182-
var spy = spyOn(stateService, "transitionTo");
182+
let spy = spyOn(stateService, "transitionTo");
183183
let A = stateRegistry.register({ name: 'A', url: '/:pA' });
184184
let B = stateRegistry.register({ name: 'B', url: '/BBB' });
185185

@@ -191,7 +191,7 @@ describe("UrlRouter", function () {
191191
});
192192

193193
it("should prioritize a path with a static string over a param 2", () => {
194-
var spy = spyOn(stateService, "transitionTo");
194+
let spy = spyOn(stateService, "transitionTo");
195195
stateRegistry.register({ name: 'foo', url: '/foo' });
196196
let A = stateRegistry.register({ name: 'foo.A', url: '/:pA' });
197197
let B = stateRegistry.register({ name: 'B', url: '/foo/BBB' });
@@ -269,7 +269,7 @@ describe("UrlRouter", function () {
269269

270270
urlService.url("/foo/123/456?query=blah");
271271
expect(matchlog).toEqual([1, 2]);
272-
})
272+
});
273273
});
274274
});
275275

@@ -284,7 +284,7 @@ describe("UrlRouter", function () {
284284
it("should return the best match for a URL 1", () => {
285285
let match: MatchResult = urlRouter.match({ path: '/BBB' });
286286
expect(match.rule.type).toBe("STATE");
287-
expect(match.rule['state']).toBe(B)
287+
expect(match.rule['state']).toBe(B);
288288
});
289289

290290
it("should return the best match for a URL 2", () => {
@@ -312,7 +312,7 @@ describe("UrlRouter", function () {
312312
};
313313

314314
registry.register({ name: 'lazy.**', url: '/lazy', lazyLoad: lazyLoad });
315-
registry.register({ name: 'param', url: '/:param', });
315+
registry.register({ name: 'param', url: '/:param' });
316316

317317
router.transitionService.onSuccess({}, trans => {
318318
expect(trans.$to()).toBe(loadedState);
@@ -322,22 +322,22 @@ describe("UrlRouter", function () {
322322
});
323323

324324
router.urlService.url('/lazy');
325-
})
326-
})
325+
});
326+
});
327327
});
328328

329329
describe('UrlRouter.deferIntercept', () => {
330-
var $ur, $url;
330+
let $ur, $url;
331331
beforeEach(function() {
332-
var router = new UIRouter();
332+
let router = new UIRouter();
333333
router.urlRouter.deferIntercept();
334334
router.plugin(TestingPlugin);
335335
$ur = router.urlRouter;
336336
$url = router.urlService;
337337
});
338338

339339
it("should allow location changes to be deferred", function () {
340-
var log = [];
340+
let log = [];
341341

342342
$ur.rule($ur.urlRuleFactory.create(/.*/, () => log.push($url.path())));
343343

0 commit comments

Comments
 (0)