Skip to content

Can you explain unit test for event emitter? #28

Description

@junjunruan

In angular-2-samples/unit-test-scenarios/event-emitter/event-emitter-spec.ts folder, can you explain the code there?

My understand about your code would be: you called the function sayHello() in the code manually.

  1. why don't you use mouse event function like click(). Of course, I don't know if there is such click function exist.
  2. why put child.sayHello(); after child.greeting.subscribe()?
  3. Can you explain how the done function work here? Is there any other way to handle asyn problem. I have heard that angular2 make it more easier to deal with the problem.
  4. When I looked at your blog: http://www.syntaxsuccess.com/viewarticle/angular-2.0-unit-testing. I still have some questions. Can you recommend me some reference to learn Angular2 an Angular2 unit testing?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions