feat(router): enforce convention of CamelCase names in route aliases

Closes #4083
This commit is contained in:
Brian Ford
2015-09-14 16:01:09 -07:00
parent cb4a9a3c04
commit 5298eb0709
3 changed files with 34 additions and 0 deletions

View File

@ -127,6 +127,14 @@ export function main() {
});
it('should throw if the route alias is not CamelCase', () => {
expect(() => recognizer.config(
new Route({path: 'app/user/:name', component: DummyCmpA, as: 'user'})))
.toThrowError(
`Route 'app/user/:name' with alias 'user' does not begin with an uppercase letter. Route aliases should be CamelCase like 'User'.`);
});
describe('params', () => {
it('should recognize parameters within the URL path', () => {
recognizer.config(new Route({path: 'profile/:name', component: DummyCmpA, as: 'User'}));