-
Notifications
You must be signed in to change notification settings - Fork 875
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this took a lot of work and you did well. Please make the changes I've noted here and then I'll be happy to merge it.
- [_triggerEventHandler_](#trigger-event-handler) | ||
* [Test a component inside a test host component](#component-inside-test-host) | ||
<br><br> | ||
* [Test a routed component](#routed-component) | ||
- [The _inject_ helper](#inject) | ||
- [The _inject_ function](#inject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer
The inject helper function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -164,7 +181,7 @@ table(width="100%") | |||
End-to-end tests explore the application _as users experience it_. | |||
In e2e testing, one process runs the real application | |||
and a second process runs protractor tests that simulate user behavior | |||
and assert that the application responds in the browser as expected. | |||
and assert that the application respond in the browser as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please roll this back. "Responds" is correctly plural. It is the application that responds, not the tests. Please fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should only have an "s" in the indicative though, not in the subjunctive. The subjunctive here is required by "assert", which introduces the subordinate clause of expectation: "that the application respond" and the change of subject. It is the same construction as "She insists that he see a doctor." An alternative in English, which usually obscures the subjunctive, is "She wants him to see a doctor." If the first clause and second clause have different subjects and there is doubt, disbelief, denial, or imposition of will (under which expectation falls), the second clause must use the subjunctive. So you get things like:
Mom expects that he eat his lunch.
The law requires that the school have a reading program.
@wardbell I hope you read that in Leonard Nimoy's voice.
@@ -229,30 +246,31 @@ a#1st-karma-test | |||
:marked | |||
**Put spec files somewhere within the `src/app/` folder.** | |||
The `karma.conf.js` tells karma to look for spec files there, | |||
for reasons explained [below](#q-spec-file-location). | |||
for reasons explained [later](#q-spec-file-location). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? "later" is better than "below". Whatever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You made me laugh. I changed it back. Below sounds more natural and lets you know it's in the same page.
### Run karma | ||
Compile and run it in karma from the command line with this command: | ||
### Run with karma | ||
Compile and run it in `karma` from the command line using the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be just karma, or maybe karma, but not karma
. We're talking about the program called karma, not a class or command. Please fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thank you for the clarification.
code-example(format="." language="bash"). | ||
npm test | ||
:marked | ||
The command compiles the application and test code and starts karma. | ||
The command compiles the application and test code and starts `karma`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace all instances of karma
with karma or karma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tend to keep it `false`. | ||
|
||
Calls `detectChanges` immediately which detects existing changes | ||
and will trigger `ngOnInit` if the component has not yet been initialized. | ||
Calls `detectChanges` immediately, which detects existing changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this sentence. I moved the sense of it up above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
When autodetect is true, the test fixture listens for _zone_ events and calls `detectChanges`. | ||
You probably still have to call `fixture.detectChanges` to trigger data binding updates | ||
when your test code modifies component property values directly. | ||
When autodetect is `true`, the test fixture listens for _zone_ events and calls `detectChanges`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
autodetect
istrue
, the test fixture callsdetectChanges
immediately after creating the component. Then it listens for pertinent zone events and callsdetectChanges
accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -2247,21 +2344,16 @@ a(href="#top").to-top Back to top | |||
|
|||
a#setup-files | |||
:marked | |||
## Setup files | |||
Many think writing tests is fun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of my favorite introductions ever. Sorry to see it go. But go it must.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!!!
@@ -2295,7 +2387,7 @@ table(width="100%") | |||
[SystemJS](https://github.com/systemjs/systemjs/blob/master/README.md) | |||
loads the application and test files. | |||
This script tells SystemJS where to find those files and how to load them. | |||
It's the same version of `systemjs.config.js` used by Setup-based applications. | |||
It's the same version of `systemjs.config.js` used by setup-based applications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same version of
systemjs.config.js
you installed during setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
as the application source code files that they test because | ||
- Such tests are easy to find | ||
- You see at a glance if a part of our application lacks tests. | ||
as the application source code files that they test because: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that they test:
Drop "because"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also noticed that that sentence started with "We". Fixed that, too.
eab98fc
to
da62f4e
Compare
da62f4e
to
a9935a6
Compare
a9935a6
to
4816416
Compare
These are copy related tech edits.