From d589eef6689da8c0b98faf727f9daafc9675b0d7 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 5 Sep 2018 10:10:50 +0800 Subject: [PATCH] =?UTF-8?q?docs(API):=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=20test/async?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/translations/cn/api-plan.md | 3 +-- packages/core/testing/src/async.ts | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index 0c54f4fd44..3b982ac0f3 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -96,10 +96,9 @@ [x] | forms/NgSelectOption | 0.17 [x] | common/PercentPipe | 0.17 [x] | forms/ValidatorFn | 0.17 -[ ] | http/RequestOptionsArgs | 0.17 [ ] | animations/animation | 0.17 [x] | common/NgSwitchCase | 0.16 -[ ] | core/testing/async | 0.16 +[x] | core/testing/async | 0.16 ## 翻译方式 diff --git a/packages/core/testing/src/async.ts b/packages/core/testing/src/async.ts index 1d67a2d25e..809864d2fe 100644 --- a/packages/core/testing/src/async.ts +++ b/packages/core/testing/src/async.ts @@ -13,8 +13,13 @@ import {asyncFallback} from './async_fallback'; * complete when all asynchronous calls within this zone are done. Can be used * to wrap an {@link inject} call. * + * 把一个测试函数包装进一个异步测试区域(Zone)。当该区域中的所有异步调用都已完成时,该测试将会自动完成。 + * 可用于包装 {@link inject} 调用。 + * * Example: * + * 例子: + * * ``` * it('...', async(inject([AClass], (object) => { * object.doSomething.then(() => { @@ -42,4 +47,4 @@ export function async(fn: Function): (done: any) => any { // TODO @JiaLiPassion, remove this after all library updated to // newest version of zone.js(0.8.25) return asyncFallback(fn); -} \ No newline at end of file +}