style(lint): re-format modules/@angular
This commit is contained in:
@ -1,12 +1,4 @@
|
||||
import {
|
||||
describe,
|
||||
it,
|
||||
iit,
|
||||
ddescribe,
|
||||
expect,
|
||||
inject,
|
||||
beforeEach,
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {describe, it, iit, ddescribe, expect, inject, beforeEach,} from '@angular/core/testing/testing_internal';
|
||||
|
||||
import {ParamRoutePath} from '../../../src/rules/route_paths/param_route_path';
|
||||
import {parser, Url} from '../../../src/url_parser';
|
||||
|
@ -1,12 +1,4 @@
|
||||
import {
|
||||
describe,
|
||||
it,
|
||||
iit,
|
||||
ddescribe,
|
||||
expect,
|
||||
inject,
|
||||
beforeEach,
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {describe, it, iit, ddescribe, expect, inject, beforeEach,} from '@angular/core/testing/testing_internal';
|
||||
|
||||
import {GeneratedUrl} from '../../../src/rules/route_paths/route_path';
|
||||
import {RegexRoutePath} from '../../../src/rules/route_paths/regex_route_path';
|
||||
@ -47,16 +39,17 @@ export function main() {
|
||||
});
|
||||
|
||||
it('should raise an error when the number of parameters doesnt match', () => {
|
||||
expect(() => {new RegexRoutePath('^a-([0-9]+)-b-([0-9]+)$', emptySerializer,
|
||||
['complete_match', 'a'])})
|
||||
expect(
|
||||
() => {new RegexRoutePath(
|
||||
'^a-([0-9]+)-b-([0-9]+)$', emptySerializer, ['complete_match', 'a'])})
|
||||
.toThrowError(`Regex group names [complete_match,a] must contain names for each matching \
|
||||
group and a name for the complete match as its first element of regex '^a-([0-9]+)-b-([0-9]+)$'. \
|
||||
3 group names are expected.`);
|
||||
});
|
||||
|
||||
it('should take group naming into account when passing params', () => {
|
||||
var rec = new RegexRoutePath('^a-([0-9]+)-b-([0-9]+)$', emptySerializer,
|
||||
['complete_match', 'a', 'b']);
|
||||
var rec = new RegexRoutePath(
|
||||
'^a-([0-9]+)-b-([0-9]+)$', emptySerializer, ['complete_match', 'a', 'b']);
|
||||
var url = parser.parse('a-123-b-345');
|
||||
var match = rec.matchUrl(url);
|
||||
expect(match.allParams).toEqual({'complete_match': 'a-123-b-345', 'a': '123', 'b': '345'});
|
||||
|
Reference in New Issue
Block a user