fix: testing.jade.
This commit is contained in:
parent
d9af771f8d
commit
3c49c10c12
@ -703,7 +703,6 @@ a(href="#top").to-top 回到顶部
|
|||||||
|
|
||||||
你可以,也应该为服务和管道编写孤立的单元测试。
|
你可以,也应该为服务和管道编写孤立的单元测试。
|
||||||
|
|
||||||
+makeExample('testing/ts/app/shared/title-case.pipe.spec.ts', 'mini-excerpt', 'app/shared/title-case.pipe.spec.ts (excerpt)')
|
|
||||||
:marked
|
:marked
|
||||||
Components can be tested in isolation as well.
|
Components can be tested in isolation as well.
|
||||||
However, isolated unit tests don't reveal how these classes interact with Angular.
|
However, isolated unit tests don't reveal how these classes interact with Angular.
|
||||||
@ -1159,7 +1158,7 @@ a(href="#top").to-top 回到顶部
|
|||||||
出人意料的是,你不敢引用测试代码里提供给测试模块`userServiceStub`对象。**它是行不通的!**。
|
出人意料的是,你不敢引用测试代码里提供给测试模块`userServiceStub`对象。**它是行不通的!**。
|
||||||
被注入组件的`userService`实例是一个彻底**不一样**的对象,是提供的`userServiceStub`的克隆。
|
被注入组件的`userService`实例是一个彻底**不一样**的对象,是提供的`userServiceStub`的克隆。
|
||||||
|
|
||||||
+makeExample('testing/ts/app/welcome.component.spec.ts', 'stub-not-injected')(format='.')
|
+makeExample('testing/ts/app/welcome.component.spec.ts', 'injected-service', 'Component\'s injector')(format='.')
|
||||||
|
|
||||||
#welcome-spec-setup
|
#welcome-spec-setup
|
||||||
:marked
|
:marked
|
||||||
|
Loading…
x
Reference in New Issue
Block a user