Skip to content

chore(test): Allow running of tests in watch mode#244

Merged
jkuri merged 1 commit intoangular:masterfrom
Brocco:test-with-watch
Feb 25, 2016
Merged

chore(test): Allow running of tests in watch mode#244
jkuri merged 1 commit intoangular:masterfrom
Brocco:test-with-watch

Conversation

@Brocco
Copy link
Copy Markdown
Contributor

@Brocco Brocco commented Feb 24, 2016

When running ng test or ng test --watch
karma tests are run after each successful build

@jkuri
Copy link
Copy Markdown
Contributor

jkuri commented Feb 24, 2016

@Brocco nice work. I just tested this and seems to work ok... so LGTM.

@Brocco
Copy link
Copy Markdown
Contributor Author

Brocco commented Feb 24, 2016

@jkuri thanks, was missing a dependency (debug) that the watcher relies upon. Updated

@jkuri
Copy link
Copy Markdown
Contributor

jkuri commented Feb 24, 2016

Okay. IMO we should avoid adding additional dependencies if it is not necessary as it increases the npm install time.

Comment thread addon/ng2/models/watcher.js Outdated
off: function() {
this.watcher.off.apply(this.watcher, arguments);
},
buildOptions: function() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing newline 😁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the whole file a copy of the ember one? Maybe we can just import it from there then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was not, but by utilizing on per the suggestion of @gkalpak it is and can be removed and re-reference the ember version again. I will update this later today, good catch!

@Brocco Brocco force-pushed the test-with-watch branch 4 times, most recently from 6b0022e to 20463d7 Compare February 24, 2016 18:05
return {
watcher: watcher,
completion: watcher.then(function() {
return new Promise(function () {}); // Run until failure or signal to exit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels wrong to me, but I don't know enough of Watcher to know if that's a common pattern. Could you just confirm in a comment that this promise should never resolve, with a link somewhere (ember github?) where people can refer instead of filling PRs/issues?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is pulled from ember, except I am returning the watcher in order to trigger tests (ember reference)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add a comment with that reference? Thanks!

@filipesilva
Copy link
Copy Markdown
Contributor

lgtm

When running `ng test` or `ng test --watch`
karma tests are run after each successful build
@hansl
Copy link
Copy Markdown
Contributor

hansl commented Feb 25, 2016

Still not sure how I feel about this, but I won't block it. LGTM.

@jkuri jkuri merged commit fb28ff6 into angular:master Feb 25, 2016
@Brocco Brocco deleted the test-with-watch branch February 26, 2016 04:03
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants