Issue 1:
It is very common for application developers to test their components with their templates. Internally we call these tests "component tests" (as opposed to unit- or integration-tests). These tests are not unit tests as they exercise more than just the component class. Nor are they integration tests as far as the application is concerned; that term is reserved for testing cross-component interactions, full application tests, and tests that involve the back-end.

Here are the requirements:

instantiate a component in a test along with its template and child components

replace child components with mocks

pass bound values to the component

trigger change detection

fake the event loop, a la FakeAsync

verify that component implement change detection correctly (e.g. via observables, immutables)

access underlying DOM to trigger user events, such as click on buttons (this is usually done with the assistance of the Page Objects framework)

Strawman:

// This annotation tells Angular about test-specific dependency overrides
@ComponentTest(
component: MyComponent,
dependencyOverrides: const {
ChildComponent: MockChildComponent,
RealGoogleMap: MockGoogleMap,
}
)
main() {
describe("my-component", () {
TestBed<MyComponent> testBed;

beforeEach(() {
testBed = createTestBedFor(MyComponent);
});

it("should work as intended", fakeAsync(async) {
// instantiates a new component
MyComponent cmp = testBed.component();

// pass bindings using normal setters
cmp.field1 = "hello";
cmp.field2 = "world";

// detectChanges runs change detection and returns how many
// components ended up reevaluated, allowing testing correctness
// of change detection
expect(testBed.detectChanges().length, 5);

// emulate passage of time
async.flushMicrotasks();
async.elapse(seconds: 1);

// get access to the DOM
Element rootElem = testBed.element();
rootElem.querySelector('some-button').click();

expect(cmp.buttonClicked, true);
});
});
}

Issue 2:
I'm submitting a ...

[x ] bug report

feature request

support request => Please do not submit support request here, see note at the top of this template.

Current behavior

I'm using angular2 with the universal component, i had my project working few weeks ago but now i wanted to install the app on another machine and i have a dependency issue

my package.json refers to

"angular2": "2.0.0-beta.15",

"angular2-universal": "0.98.3"

...

on my local machine, the initial install made few weeks ago succesfully installed the following

+-- angular2@2.0.0-beta.15

+-- angular2-universal@0.98.3

| +-- angular2-express-engine@0.11.1

| +-- angular2-hapi-engine@0.11.1

| +-- angular2-universal-polyfills@0.4.1

| | +-- es6-promise@3.0.2

| | `-- ie-shim@0.1.0

...

same thing today on another machine gives

+-- angular2@2.0.0-beta.15

+-- angular2-universal@0.98.3

| +-- angular2-express-engine@0.13.1

| +-- angular2-hapi-engine@0.13.1

| +-- UNMET PEER DEPENDENCY angular2-universal@^0.101.4

| +-- angular2-universal-polyfills@0.4.1

| | +-- es6-promise@3.0.2

| | `-- ie-shim@0.1.0

...

and i assume that this is why my project aint working there

Expected/desired behavior

have a package that works with those dependencies

What is the motivation / use case for changing the behavior?

it just fails

Please tell us about your environment:

node 5.11.1

windows 7

Angular version: 2.0.0-beta.15

Browser: [all ]

Language: [ TypeScript]