Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the <h1> :(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad!!!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be center

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it <marquee>

<%= dasherizedModuleName %> Works!
<%= dasherizedModuleName %> works!
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,13 @@ import {
ComponentFixture,
TestComponentBuilder
} from 'angular2/testing';
import {provide} from 'angular2/core';<% if (route) { %>
import {Router, RouteParams} from 'angular2/router';<% } %>
import {<%= classifiedModuleName %>Component} from './<%= dasherizedModuleName %>.component';<% if (route) { %>
class MockRouter {
registerPrimaryOutlet() { }
}
import {<%= classifiedModuleName %>Component} from './<%= dasherizedModuleName %>.component';

class MockRouteParams {
get() { return 1; }
}<% } %>

describe('<%= classifiedModuleName %> Component', () => {
<% if (route) { %>
beforeEachProviders(() => [
provide(Router, { useClass: MockRouter }),
provide(RouteParams, { useClass: MockRouteParams }),
]);
<% } else { %>
beforeEachProviders((): any[] => []);
<% } %>
it('should ...', async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => {
return tcb.createAsync(<%= classifiedModuleName %>Component).then((fixture: ComponentFixture) => {
fixture.detectChanges();
});
})));
describe('Component: <%= classifiedModuleName %>', () => {
beforeEachProviders(() => [<%= classifiedModuleName %>Component]);

it('should create the component', inject([<%= classifiedModuleName %>Component], (component: <%= classifiedModuleName %>Component) => {
expect(component).toBeTruthy();
}));

});
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>
<%= htmlComponentName %> Works!
</p>
<h1>
<%= htmlComponentName %> works!
</h1>
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import {describe, it, expect, beforeEachProviders, inject} from 'angular2/testing';
import {
async,
beforeEachProviders,
describe,
ddescribe,
expect,
iit,
it,
inject,
ComponentFixture,
TestComponentBuilder
} from 'angular2/testing';
import {<%= jsComponentName %>App} from '../app/<%= htmlComponentName %>.component';

beforeEachProviders(() => [<%= jsComponentName %>App]);

describe('App: <%= jsComponentName %>', () => {
it('should have the `defaultMeaning` as 42', inject([<%= jsComponentName %>App], (app: <%= jsComponentName %>App) => {
expect(app.defaultMeaning).toBe(42);
}));

describe('#meaningOfLife', () => {
it('should get the meaning of life', inject([<%= jsComponentName %>App], (app: <%= jsComponentName %>App) => {
expect(app.meaningOfLife()).toBe('The meaning of life is 42');
expect(app.meaningOfLife(22)).toBe('The meaning of life is 22');
}));
});
describe('App: <%= jsComponentName %>', () => {
it('should create the app', inject([<%= jsComponentName %>App], (app: <%= jsComponentName %>App) => {
expect(app).toBeTruthy();
}));
});

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@ import {Component} from 'angular2/core';
styleUrls: ['<%= dasherizedModuleName %>.component.<%= styleExt %>']
})
export class <%= jsComponentName %>App {
defaultMeaning: number = 42;

meaningOfLife(meaning?: number) {
return `The meaning of life is ${meaning || this.defaultMeaning}`;
}
}