Skip to content

1-js/03-code-quality/05-testing-mocha#39

Merged
leviding merged 5 commits intozh-hansfrom
transfer/testing-mocha
Apr 24, 2018
Merged

1-js/03-code-quality/05-testing-mocha#39
leviding merged 5 commits intozh-hansfrom
transfer/testing-mocha

Conversation

@linhe0x0
Copy link
Copy Markdown

resolve #21

resolve #21
@leviding leviding added the WIP Work in process label Apr 12, 2018
@linhe0x0 linhe0x0 changed the title [WIP] 1-js/03-code-quality/05-testing-mocha 1-js/03-code-quality/05-testing-mocha Apr 12, 2018
@linhe0x0 linhe0x0 removed the WIP Work in process label Apr 12, 2018
@linhe0x0 linhe0x0 self-assigned this Apr 12, 2018
@allenlongbaobao
Copy link
Copy Markdown
Contributor

校对认领

@leviding
Copy link
Copy Markdown
Member

@allenlongbaobao ok

Copy link
Copy Markdown
Contributor

@allenlongbaobao allenlongbaobao left a comment

Choose a reason for hiding this comment

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

校对完毕! @sqrthree @leviding

自动化测试在任务中将会被进一步使用。

It's actually a part of the "educational minimum" of a developer.
它实际上是一个开发者的“教育最低限度”的一部分。
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.

中文引号用全角

当我们在写一个函数时,我们通常可以想象出它应该做什么:哪些参数会给出哪些结果。

During development, we can check the function by running it and comparing the outcome with the expected one. For instance, we can do it in the console.
在开发期间,我们可以通过运行程序来检查它并将结果与预期的果进行比较。例如,我们可以在控制台中这么做。
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.

多余的 「果」

如果出了问题 —— 那么我们会修复代码,然后再一次运行并检查结果 —— 直到它工作为止。

But such manual "re-runs" are imperfect.
但这样的手动“重新运行”是不完美的。
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.

全角引号

Copy link
Copy Markdown
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.

不好意思,没有表达清楚。是中文引号。
[“重新运行”] => [「重新运行」]


`it("title", function() { ... })`
: In the title of `it` we *in a human-readable way* describe the particular use case, and the second argument is a function that tests it.
: `it` 里面的 “title” 中我们可以以**人类可读**的方式描述特定的用例,第二个参数是一个测试它的函数。
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.

把 [可以] 去掉

如此来看,开发是**迭代**的。我们写规范,实现它,确保测试通过,然后写更多的测试来确保它们工作等等。最后,我们有了一个能工作的实现和针对它的测试。

In our case, the first step is complete: we have an initial spec for `pow`. So let's make an implementation. But before that let's make a "zero" run of the spec, just to see that tests are working (they will all fail).
在我们的案例中,第一步已经完成了:针对 `pow` 我们有一个初始规范。因此让我们来实现它吧。但在此之前,让我们做一个针对规范的“零”运行,只是为了看到测试正在运行(他们都会失败)。
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.

全角引号

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.

[他们] => [它们]

sqrtthree added 2 commits April 24, 2018 10:57
@linhe0x0
Copy link
Copy Markdown
Author

@leviding Done.

@leviding leviding merged commit e9a6ac1 into zh-hans Apr 24, 2018
@leviding leviding deleted the transfer/testing-mocha branch April 24, 2018 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants