diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.chinese.md
index 68d086f21a..6ab8f79315 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/assert-deep-equality-with-.deepequal-and-.notdeepequal.chinese.md
@@ -2,15 +2,20 @@
id: 587d824c367417b2b2512c4c
title: Assert Deep Equality with .deepEqual and .notDeepEqual
challengeType: 2
-videoUrl: ''
-localeTitle: 使用.deepEqual和.notDeepEqual断言深度等式
+forumTopicId: 301587
+localeTitle: 用 Assert.deepEqual() 和 Assert.notDeepEqual() 断言深度相等
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 .deepEqual(),. noDeepEqual()。deepEqual()断言两个对象是深度相等的
+
## Instructions
-
+
+使用 assert.deepEqual()
或者 assert.notDeepEqual()
来让测试通过。
+
## Tests
@@ -18,11 +23,11 @@ localeTitle: 使用.deepEqual和.notDeepEqual断言深度等式
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=6').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - deepEqual vs. notDeepEqual
+ - text: 请选择正确的断言—deepEqual 或 notDeepEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=6').then(data => { assert.equal(data.assertions[0].method, 'deepEqual', 'The order of the keys does not matter'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - deepEqual vs. notDeepEqual
+ - text: 请选择正确的断言—deepEqual 或 notDeepEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=6').then(data => { assert.equal(data.assertions[1].method, 'notDeepEqual', 'The position of elements within an array does matter'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +43,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.chinese.md
index c0fe53daa9..cf032c4896 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/compare-the-properties-of-two-elements.chinese.md
@@ -2,15 +2,19 @@
id: 587d824c367417b2b2512c4d
title: Compare the Properties of Two Elements
challengeType: 2
-videoUrl: ''
+forumTopicId: 301588
localeTitle: 比较两个元素的属性
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 .isAbove()=> a> b,.isAtMost()=> a <= b
+
## Instructions
-
+
+使用 assert.isAbove()
(大于)或者 assert.isAtMost()
(小于或等于)来让测试通过。
+
## Tests
@@ -18,15 +22,15 @@ localeTitle: 比较两个元素的属性
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=7').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isAbove vs. isAtMost
+ - text: 请选择正确的断言—isAbove 或 isAtMost
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=7').then(data => { assert.equal(data.assertions[0].method, 'isAtMost', '5 is at most (<=) 5'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isAbove vs. isAtMost
+ - text: 请选择正确的断言—isAbove 或 isAtMost
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=7').then(data => { assert.equal(data.assertions[1].method, 'isAbove', '1 is greater than 0'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isAbove vs. isAtMost
+ - text: 请选择正确的断言—isAbove 或 isAtMost
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=7').then(data => { assert.equal(data.assertions[2].method, 'isAbove', 'Math.PI = 3.14159265 is greater than 3'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isAbove vs. isAtMost
+ - text: 请选择正确的断言—isAbove 或 isAtMost
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=7').then(data => { assert.equal(data.assertions[3].method, 'isAtMost', '1 - Math.random() is > 0 and <= 1. It is atMost 1 !'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +46,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.chinese.md
index fef6303549..debc7ccee3 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/learn-how-javascript-assertions-work.chinese.md
@@ -2,15 +2,19 @@
id: 587d824a367417b2b2512c46
title: Learn How JavaScript Assertions Work
challengeType: 2
-videoUrl: ''
-localeTitle: 了解JavaScript断言的工作原理
+forumTopicId: 301589
+localeTitle: 了解 JavaScript 断言是如何使用的
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。使用assert.isNull()或assert.isNotNull()来使测试通过。
+
## Instructions
-
+
+使用 assert.isNull() 或 assert.isNotNull() 来让测试通过。
## Tests
@@ -18,11 +22,11 @@ localeTitle: 了解JavaScript断言的工作原理
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=0').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isNull vs. isNotNull
+ - text: 请选择正确的断言—isNull 或 isNotNull
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=0').then(data => { assert.equal(data.assertions[0].method, 'isNull', 'Null is null'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isNull vs. isNotNull
+ - text: You should choose the right assertion - isNull vs. isNotNull.
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=0').then(data => { assert.equal(data.assertions[1].method, 'isNotNull', '1 is not null'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +42,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.chinese.md
index ce1266f7cd..7354809891 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iii---put-method.chinese.md
@@ -2,15 +2,46 @@
id: 587d824f367417b2b2512c5a
title: Run Functional Tests on an API Response using Chai-HTTP III - PUT method
challengeType: 2
-videoUrl: ''
-localeTitle: 使用Chai-HTTP III-PUT方法在API响应上运行功能测试
+forumTopicId: 301590
+localeTitle: 使用 Chai-HTTP 测试 API 响应结果 (3)—PUT 方法
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。在下一个示例中,我们将看到如何在请求有效负载(正文)中发送数据。我们将测试PUT请求。 '/ travelers'端点接受一个采用结构的JSON对象:{surname:[过去的旅行者的姓氏]},路由响应:{name:[first name],surname:[last name],dates :[birth - death years]}查看服务器代码以获取更多详细信息。发送{姓:'科伦坡'}。替换assert.fail()并使测试通过。检查1)状态,2)类型,3)body.name,4)body.surname遵循上面的断言顺序,我们依赖它。
+
+请注意,本项目在 这个 Repl.it 项目 的基础上进行开发。你也可以从 GitHub 上克隆。
+接下来,我们将了解如何使用请求的 payload(body)发送数据。
+我们需要测试一个 PUT 请求,'/travellers'
接收如下的 JSON 对象:
+
+```json
+{
+ "surname": [last name of a traveller of the past]
+}
+```
+
+响应数据如下:
+
+```json
+{
+ "name": [first name], "surname": [last name], "dates": [birth - death years]
+}
+```
+
+更多细节请查看服务器代码。
+
+
## Instructions
-
+
+发送
+
+```json
+{
+ "surname": "Colombo"
+}
+```
+替换 assert.fail()
使测试通过。
+分别测试 1) status
,2) type
,3) body.name
,4) body.surname
+请按照以上顺序书写断言,顺序错误会影响此挑战的判定。
## Tests
@@ -18,16 +49,16 @@ localeTitle: 使用Chai-HTTP III-PUT方法在API响应上运行功能测试
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 您应该测试'res.status'为200
+ - text: 你需要测试 'res.status' 是否为 200
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.assertions[0].method, 'equal'); assert.equal(data.assertions[0].args[0], 'res.status'); assert.equal(data.assertions[0].args[1], '200');}, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.type'是'application / json'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.assertions[1].method, 'equal'); assert.equal(data.assertions[1].args[0], 'res.type'); assert.equal(data.assertions[1].args[1], '\'application/json\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: 您应该测试'res.body.name'为'Cristoforo'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.assertions[2].method, 'equal'); assert.equal(data.assertions[2].args[0], 'res.body.name'); assert.equal(data.assertions[2].args[1], '\'Cristoforo\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.body.surname'是'科伦坡'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.assertions[3].method, 'equal'); assert.equal(data.assertions[3].args[0], 'res.body.surname'); assert.equal(data.assertions[3].args[1], '\'Colombo\'');}, xhr => { throw new Error(xhr.responseText); })
+ - text: 你需要测试 'res.type' 是否为 'application/json'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.assertions[1].method, 'equal'); assert.equal(data.assertions[1].args[0], 'res.type'); assert.match(data.assertions[1].args[1], /('|")application\/json\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 你需要测试 'res.body.name' 是否为 'Cristoforo'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.assertions[2].method, 'equal'); assert.equal(data.assertions[2].args[0], 'res.body.name'); assert.match(data.assertions[2].args[1], /('|")Cristoforo\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 你需要测试 'res.body.surname' 是否为 'Colombo'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=2').then(data => { assert.equal(data.assertions[3].method, 'equal'); assert.equal(data.assertions[3].args[0], 'res.body.surname'); assert.match(data.assertions[3].args[1], /('|")Colombo\1/);}, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +73,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.chinese.md
index 595e08d3a1..14ac30b406 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-an-api-response-using-chai-http-iv---put-method.chinese.md
@@ -2,15 +2,30 @@
id: 587d824f367417b2b2512c5b
title: Run Functional Tests on an API Response using Chai-HTTP IV - PUT method
challengeType: 2
-videoUrl: ''
-localeTitle: 使用Chai-HTTP IV - PUT方法在API响应上运行功能测试
+forumTopicId: 301591
+localeTitle: 使用 Chai-HTTP 测试 API 响应结果 (4)—PUT 方法
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。此练习与前面的练习类似。看看它的细节。发送{姓:'da Verrazzano'}。替换assert.fail()并使测试通过。检查1)状态,2)类型,3)body.name,4)body.surname遵循上面的断言顺序,我们依赖它。
+
## Instructions
-
+
+发送
+
+```json
+{
+ "surname": "da Verrazzano"
+}
+```
+
+替换 assert.fail(),使测试通过。
+分别测试 1) status
,2) type
,3) body.name
,4) body.surname
+请按照以上顺序书写断言,顺序错误会影响此挑战的判定。
## Tests
@@ -18,16 +33,16 @@ localeTitle: 使用Chai-HTTP IV - PUT方法在API响应上运行功能测试
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 您应该测试'res.status'为200
+ - text: 你需要测试 'res.status' 是否为 200
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.assertions[0].method, 'equal'); assert.equal(data.assertions[0].args[0], 'res.status'); assert.equal(data.assertions[0].args[1], '200');}, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.type'是'application / json'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.assertions[1].method, 'equal'); assert.equal(data.assertions[1].args[0], 'res.type'); assert.equal(data.assertions[1].args[1], '\'application/json\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: 您应该测试'res.body.name'为'Giovanni'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.assertions[2].method, 'equal'); assert.equal(data.assertions[2].args[0], 'res.body.name'); assert.equal(data.assertions[2].args[1], '\'Giovanni\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.body.surname'是'da Verrazzano'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.assertions[3].method, 'equal'); assert.equal(data.assertions[3].args[0], 'res.body.surname'); assert.equal(data.assertions[3].args[1], '\'da Verrazzano\'');}, xhr => { throw new Error(xhr.responseText); })
+ - text: 你需要测试 'res.type' 是否为 'application/json'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.assertions[1].method, 'equal'); assert.equal(data.assertions[1].args[0], 'res.type'); assert.match(data.assertions[1].args[1], /('|")application\/json\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 你需要测试 'res.body.name' 是否为 'Giovanni'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.assertions[2].method, 'equal'); assert.equal(data.assertions[2].args[0], 'res.body.name'); assert.match(data.assertions[2].args[1], /('|")Giovanni\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 你需要测试 'res.body.surname' 是否为 'da Verrazzano'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=3').then(data => { assert.equal(data.assertions[3].method, 'equal'); assert.equal(data.assertions[3].args[0], 'res.body.surname'); assert.match(data.assertions[3].args[1], /('|")da Verrazzano\1/);}, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +57,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.chinese.md
index 560d0a75e0..1c24c36428 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http-ii.chinese.md
@@ -2,15 +2,20 @@
id: 587d824f367417b2b2512c59
title: Run Functional Tests on API Endpoints using Chai-HTTP II
challengeType: 2
-videoUrl: ''
-localeTitle: 使用Chai-HTTP II在API端点上运行功能测试
+forumTopicId: 301592
+localeTitle: 使用 Chai-HTTP 进行 API 功能测试 (2)
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。替换assert.fail()。测试状态和text.response。让测试通过。在追加的查询中发送您的姓名吗?name = ,端点以'你好'回应 ”。
+
## Instructions
-
+
+测试 status 和 text.response
。替换 assert.fail()
使测试通过。
+请把 name 的值添加到 query 结尾:?name=<your_name>
,后端将会返回 'hello <your_name>'
。
## Tests
@@ -18,11 +23,11 @@ localeTitle: 使用Chai-HTTP II在API端点上运行功能测试
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=1').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.status'== 200
+ - text: 你需要测试 'res.status' 是否为 200
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=1').then(data => { assert.equal(data.assertions[0].method, 'equal'); assert.equal(data.assertions[0].args[0], 'res.status'); assert.equal(data.assertions[0].args[1], '200');}, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.text'=='你好客人'
+ - text: 你需要测试 'res.text' 是否为 'hello Guest'
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=1').then(data => { assert.equal(data.assertions[1].method, 'equal'); assert.equal(data.assertions[1].args[0], 'res.text'); assert.match(data.assertions[1].args[1], /hello [\w\d_-]/);}, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +43,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.chinese.md
index 350d6780c1..59eb620036 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-on-api-endpoints-using-chai-http.chinese.md
@@ -2,15 +2,20 @@
id: 587d824e367417b2b2512c58
title: Run Functional Tests on API Endpoints using Chai-HTTP
challengeType: 2
-videoUrl: ''
-localeTitle: 使用Chai-HTTP在API端点上运行功能测试
+forumTopicId: 301593
+localeTitle: 使用 Chai-HTTP 进行 API 功能测试 (1)
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。替换assert.fail()。测试状态和text.response。让测试通过。不要在查询中发送名称,端点会以“hello Guest”响应。
+
## Instructions
-
+
+测试 status 和 text.response
。替换 assert.fail()
使测试通过。
+不要在 query 中传入 name,后端将会返回 "hello Guest"。
## Tests
@@ -18,12 +23,12 @@ localeTitle: 使用Chai-HTTP在API端点上运行功能测试
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=0').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.status'== 200
+ - text: 你需要测试 'res.status' 是否为 200
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=0').then(data => { assert.equal(data.assertions[0].method, 'equal'); assert.equal(data.assertions[0].args[0], 'res.status'); assert.equal(data.assertions[0].args[1], '200');}, xhr => { throw new Error(xhr.responseText); })
- - text: 你应该测试'res.text'=='你好客人'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=0').then(data => { assert.equal(data.assertions[1].method, 'equal'); assert.equal(data.assertions[1].args[0], 'res.text'); assert.equal(data.assertions[1].args[1], '\'hello Guest\'');}, xhr => { throw new Error(xhr.responseText); })
+ - text: 你需要测试 'res.text' 是否为 'hello Guest'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=0').then(data => { assert.equal(data.assertions[1].method, 'equal'); assert.equal(data.assertions[1].args[0], 'res.text'); assert.match(data.assertions[1].args[1], /('|")hello Guest\1/);}, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +43,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.chinese.md
index c1c66a8669..7e4fafd182 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser-ii.chinese.md
@@ -2,15 +2,20 @@
id: 587d8250367417b2b2512c5d
title: Run Functional Tests using a Headless Browser II
challengeType: 2
-videoUrl: ''
-localeTitle: 使用无头浏览器II运行功能测试
+forumTopicId: 301594
+localeTitle: 使用 headless 浏览器运行功能测试 (2)
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。此练习与前面的练习类似。查看方向代码。按照断言顺序,我们依靠它。
+
## Instructions
-
+
+此挑战与之前的挑战十分类似。
+请阅读此挑战给出的代码指引,按顺序书写断言。顺序错误会影响此挑战的判定。
## Tests
@@ -18,16 +23,16 @@ localeTitle: 使用无头浏览器II运行功能测试
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 断言无头浏览器请求成功
+ - text: Headless browser 应成功执行请求
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.assertions[0].method, 'browser.success'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 断言元素“span#name”中的文本是“Amerigo”
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.assertions[1].method, 'browser.text'); assert.equal(data.assertions[1].args[0], '\'span#name\''); assert.equal(data.assertions[1].args[1], '\'Amerigo\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: 断言元素“span#surname”中的文本是“Vespucci”
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.assertions[2].method, 'browser.text'); assert.equal(data.assertions[2].args[0], '\'span#surname\''); assert.equal(data.assertions[2].args[1], '\'Vespucci\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: '断言元素“span #dalendar”存在且其计数为1'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.assertions[3].method, 'browser.element'); assert.equal(data.assertions[3].args[0], '\'span#dates\''); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 元素 'span#name' 中的文字应为 'Amerigo'.
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.assertions[1].method, 'browser.text'); assert.match(data.assertions[1].args[0], /('|")span#name\1/); assert.match(data.assertions[1].args[1], /('|")Amerigo\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 元素 'span#surname' 中的文字应为 'Vespucci'.
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.assertions[2].method, 'browser.text'); assert.match(data.assertions[2].args[0], /('|")span#surname\1/); assert.match(data.assertions[2].args[1], /('|")Vespucci\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 元素 'span#dates' 应存在,并且只有一个
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=5').then(data => { assert.equal(data.assertions[3].method, 'browser.element'); assert.match(data.assertions[3].args[0], /('|")span#dates\1/); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +47,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.chinese.md
index f5ab7893fa..b83daa82be 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser.chinese.md
@@ -2,15 +2,22 @@
id: 587d824f367417b2b2512c5c
title: Run Functional Tests using a Headless Browser
challengeType: 2
-videoUrl: ''
-localeTitle: 使用无头浏览器运行功能测试
+forumTopicId: 301595
+localeTitle: 使用 headless 浏览器运行功能测试 (1)
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。在接下来的挑战中,我们将使用名为“Headless Browser”的设备模拟人与页面的交互。无头浏览器是没有图形用户界面的Web浏览器。这些工具对于测试网页特别有用,因为它们能够以与浏览器相同的方式呈现和理解HTML,CSS和JavaScript。对于这些挑战,我们使用的是Zombie.JS。它是一个完全基于JS的轻量级浏览器,不依赖于安装其他二进制文件。此功能使其可用于Glitch等环境。还有许多其他(更强大的)选项。
查看练习方向代码中的示例按照断言顺序,我们依赖它。
+
+请注意,本项目在 这个 Repl.it 项目 的基础上进行开发。你也可以从 GitHub 上克隆。
+在这一项挑战中,我们将会使用 Headless Browser(无头浏览器)模拟人机交互。
+无头浏览器 是一种没有图形用户界面的浏览器。这类工具对网页调试特别有效,因为它们可以跟普通浏览器一样理解和渲染 HTML,CSS 和 JavaScript。
+
+
## Instructions
-
+
+在这个挑战中,我们将使用 Zombie.JS。它是一款完全基于 JS 的轻量级浏览器,不需要安装其他二进制文件。这个特性让它轻松地在如 Repl.it 的环境下使用。除此之外,还有很多(更强大的)Headless Browser 选项。
+请阅读此挑战给出的代码指引,按顺序书写断言。顺序错误会影响此挑战的判定。
## Tests
@@ -18,16 +25,16 @@ localeTitle: 使用无头浏览器运行功能测试
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 断言无头浏览器请求成功
+ - text: Headless browser 应成功执行请求
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.assertions[0].method, 'browser.success'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 断言元素“span#name”中的文本是“Cristoforo”
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.assertions[1].method, 'browser.text'); assert.equal(data.assertions[1].args[0], '\'span#name\''); assert.equal(data.assertions[1].args[1], '\'Cristoforo\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: 断言元素“span#surname”中的文本是“Colombo”
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.assertions[2].method, 'browser.text'); assert.equal(data.assertions[2].args[0], '\'span#surname\''); assert.equal(data.assertions[2].args[1], '\'Colombo\'');}, xhr => { throw new Error(xhr.responseText); })
- - text: '断言元素“span #dalendar”存在且其计数为1'
- testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.assertions[3].method, 'browser.element'); assert.equal(data.assertions[3].args[0], '\'span#dates\''); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 元素 'span#name' 中的文字应为 'Cristoforo'
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.assertions[1].method, 'browser.text'); assert.match(data.assertions[1].args[0], /('|")span#name\1/); assert.match(data.assertions[1].args[1], /('|")Cristoforo\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 元素 'span#surname' 中的文字应为 'Colombo'.
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.assertions[2].method, 'browser.text'); assert.match(data.assertions[2].args[0], /('|")span#surname\1/); assert.match(data.assertions[2].args[1], /('|")Colombo\1/);}, xhr => { throw new Error(xhr.responseText); })
+ - text: 元素 'span#dates' 应存在,并且只有一个
+ testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=functional&n=4').then(data => { assert.equal(data.assertions[3].method, 'browser.element'); assert.match(data.assertions[3].args[0], /('|")span#dates\1/); assert.equal(data.assertions[3].args[1], 1);}, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +49,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.chinese.md
index 827725fd54..b639638c04 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-for-truthiness.chinese.md
@@ -7,10 +7,24 @@ localeTitle: 测试真实性
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。使用assert.isTrue()或assert.isNotTrue()来使测试通过。 .isTrue(true)和.isNotTrue(其他所有内容)都将通过。 .isFalse()和.isNotFalse()也存在。
+
+请注意,本项目在 这个 Repl.it 项目 的基础上进行开发。你也可以从 GitHub 上克隆。
+
+isTrue()
仅当给出的值为 Boolean 的 true
时可以通过测试;isNotTrue()
则会在给出除 true
以外的值时通过测试。
+
+```js
+assert.isTrue(true, '可以通过,因为值的类型是布尔且值为 true');
+assert.isTrue('true', '不能通过,因为值的类型是字符串);
+assert.isTrue(1, '不过能通过,因为值是数字 1');
+```
+
+
+isFalse()
和 isNotFalse()
同样存在,表现与上面提到的两个方法类似。
+
## Instructions
-
+
+使用 assert.isTrue()
或 assert.isNotTrue()
让测试通过。
## Tests
@@ -18,13 +32,13 @@ localeTitle: 测试真实性
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=3').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isTrue vs. isNotTrue
+ - text: 请选择正确的断言—isTrue 或 isNotTrue
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=3').then(data => { assert.equal(data.assertions[0].method, 'isTrue', 'True is true'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isTrue vs. isNotTrue
+ - text: 请选择正确的断言—isTrue 或 isNotTrue
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=3').then(data => { assert.equal(data.assertions[1].method, 'isTrue', 'Double negation of a truthy value is true'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isTrue vs. isNotTrue
+ - text: 请选择正确的断言—isTrue 或 isNotTrue
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=3').then(data => { assert.equal(data.assertions[2].method, 'isNotTrue', 'A truthy object is not true - neither is a false one'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -40,7 +54,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.chinese.md
index 2d4dbe3e72..9b5e9a8ebf 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-string-contains-a-substring.chinese.md
@@ -2,15 +2,22 @@
id: 587d824d367417b2b2512c53
title: Test if a String Contains a Substring
challengeType: 2
-videoUrl: ''
-localeTitle: 测试String是否包含子串
+forumTopicId: 301597
+localeTitle: 测试字符串是否包含子字符串
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 #include(在#notInclude上)也适用于字符串!!它断言实际的字符串包含预期的子字符串
+
+请注意,本项目在 这个 Repl.it 项目 的基础上进行开发。你也可以从 GitHub 上克隆。
+
+include()
和 notInclude()
同样可以用于字符串。
+include()
用于断言字符串中包含某个子字符串。
+
## Instructions
-
+
+使用 assert.include()
或 assert.notInclude()
让测试通过。
+
## Tests
@@ -18,11 +25,11 @@ localeTitle: 测试String是否包含子串
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=13').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - include与notInclude
+ - text: 请选择正确的断言—include 或 notInclude
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=13').then(data => { assert.equal(data.assertions[0].method, 'include', '\'Arrow\' contains \'row\'...'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - include与notInclude
+ - text: 请选择正确的断言—include 或 notInclude
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=13').then(data => { assert.equal(data.assertions[1].method, 'notInclude', '... a \'dart\' doesn\'t contain a \'queue\''); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +45,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.chinese.md
index ce0b7dc605..01951ce775 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range.chinese.md
@@ -2,15 +2,22 @@
id: 587d824c367417b2b2512c4f
title: Test if a Value Falls within a Specific Range
challengeType: 2
-videoUrl: ''
-localeTitle: 测试值是否在特定范围内
+forumTopicId: 301598
+localeTitle: 测试某个值是否在特定范围内
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 。近似。(实际,预期,范围,[消息])实际=预期+/-范围选择最小范围(第3个参数)使测试始终通过它应小于1
+
+请注意,本项目在 这个 Repl.it 项目 的基础上进行开发。你也可以从 GitHub 上克隆。
+
+.approximately(actual, expected, delta, [message])
+断言待测试的值处于 expected
+/- delta
的范围内。
+
## Instructions
-
+
+使用 assert.approximately()
让测试通过。
+选择最小范围(第三个参数)来通过所有测试。它应该小于 1。
## Tests
@@ -18,11 +25,11 @@ localeTitle: 测试值是否在特定范围内
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=9').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 使用大约(实际,预期,范围) - 选择正确的范围
+ - text: 你应使用 approximately(actual, expected, range) 并选择正确的范围
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=9').then(data => { assert.equal(data.assertions[0].method, 'approximately'); assert.equal(data.assertions[0].args[2], 0.5, 'weirdNumbers(0.5) is in the range (0.5, 1.5]. It\'s within 1 +/- 0.5'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 使用大约(实际,预期,范围) - 选择正确的范围
+ - text: 你应使用 approximately(actual, expected, range) 并选择正确的范围
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=9').then(data => { assert.equal(data.assertions[1].method, 'approximately'); assert.equal(data.assertions[1].args[2], 0.8, 'weirdNumbers(0.2) is in the range (0.2, 1.2]. It\'s within 1 +/- 0.8'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +45,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.chinese.md
index 6c7811c75c..2ebcee8701 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-a-string.chinese.md
@@ -2,15 +2,19 @@
id: 587d824d367417b2b2512c52
title: Test if a Value is a String
challengeType: 2
-videoUrl: ''
-localeTitle: 测试值是否为字符串
+forumTopicId: 301599
+localeTitle: 测试某个值是否为字符串
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 #isString断言实际值是一个字符串。
+
## Instructions
-
+
+使用 assert.isString()
或 assert.isNotString()
让所有测试通过。
## Tests
@@ -18,13 +22,13 @@ localeTitle: 测试值是否为字符串
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=12').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isString vs. isNotString
+ - text: 请选择正确的断言—isString 或 isNotString
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=12').then(data => { assert.equal(data.assertions[0].method, 'isNotString', 'A float number is not a string'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isString vs. isNotString
+ - text: 请选择正确的断言—isString 或 isNotString
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=12').then(data => { assert.equal(data.assertions[1].method, 'isString', 'environment vars are strings (or undefined)'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isString vs. isNotString
+ - text: 请选择正确的断言—isString 或 isNotString
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=12').then(data => { assert.equal(data.assertions[2].method, 'isString', 'A JSON is a string'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -40,7 +44,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.chinese.md
index 106ab1a55b..b3c6b16c47 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-an-array.chinese.md
@@ -2,15 +2,18 @@
id: 587d824d367417b2b2512c50
title: Test if a Value is an Array
challengeType: 2
-videoUrl: ''
-localeTitle: 测试值是否为数组
+forumTopicId: 301600
+localeTitle: 测试某个值是否为数组
---
## Description
-
+
## Instructions
-
+
+使用 assert.isArray()
或 assert.isNotArray()
让所有测试通过。
## Tests
@@ -18,11 +21,11 @@ localeTitle: 测试值是否为数组
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=10').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isArray vs. isNotArray
+ - text: 请选择正确的断言—isArray 或 isNotArray
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=10').then(data => { assert.equal(data.assertions[0].method, 'isArray', 'String.prototype.split() returns an Array'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isArray vs. isNotArray
+ - text: 请选择正确的断言—isArray 或 isNotArray
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=10').then(data => { assert.equal(data.assertions[1].method, 'isNotArray', 'Array.prototype.indexOf() returns a number'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +41,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.chinese.md
index c7435bacc6..da59b2b70e 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-value-is-of-a-specific-data-structure-type.chinese.md
@@ -2,15 +2,20 @@
id: 587d824e367417b2b2512c56
title: Test if a Value is of a Specific Data Structure Type
challengeType: 2
-videoUrl: ''
+forumTopicId: 301601
localeTitle: 测试值是否为特定数据结构类型
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 #typeOf断言值的类型是给定的字符串,由Object.prototype.toString确定。在适当的地方使用#typeOf或#notTypeOf
+
+请注意,本项目在 这个 Repl.it 项目 的基础上进行开发。你也可以从 GitHub 上克隆。
+#typeOf
断言一个值的类型符合给定的类型,这个类型与 Object.prototype.toString
一致。
+
+
## Instructions
-
+
+使用 assert.typeOf()
或 assert.notTypeOf()
让所有测试通过。
## Tests
@@ -18,17 +23,17 @@ localeTitle: 测试值是否为特定数据结构类型
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=16').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - typeOf vs. notTypeOf
+ - text: 请选择正确的断言—typeOf 或 notTypeOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=16').then(data => { assert.equal(data.assertions[0].method, 'typeOf', 'myCar is typeOf Object'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - typeOf vs. notTypeOf
+ - text: 请选择正确的断言—typeOf 或 notTypeOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=16').then(data => { assert.equal(data.assertions[1].method, 'typeOf', 'Car.model is a String'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - typeOf vs. notTypeOf
+ - text: 请选择正确的断言—typeOf 或 notTypeOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=16').then(data => { assert.equal(data.assertions[2].method, 'notTypeOf', 'Plane.wings is a Number (not a String)'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - typeOf vs. notTypeOf
+ - text: 请选择正确的断言—typeOf 或 notTypeOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=16').then(data => { assert.equal(data.assertions[3].method, 'typeOf', 'Plane.engines is an Array'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - typeOf vs. notTypeOf
+ - text: 请选择正确的断言—typeOf 或 notTypeOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=16').then(data => { assert.equal(data.assertions[4].method, 'typeOf', 'Car.wheels is a Number'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -44,7 +49,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.chinese.md
index bcecfa4b3e..701883d43f 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-a-variable-or-function-is-defined.chinese.md
@@ -2,15 +2,19 @@
id: 587d824b367417b2b2512c47
title: Test if a Variable or Function is Defined
challengeType: 2
-videoUrl: ''
-localeTitle: 测试变量或函数是否定义
+forumTopicId: 301602
+localeTitle: 测试变量或函数是否已定义
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。使用assert.isDefined()或assert.isUndefined()来使测试通过
+
## Instructions
-
+
+使用 assert.isDefined()
或 assert.isUndefined()
让测试通过。
## Tests
@@ -18,13 +22,13 @@ localeTitle: 测试变量或函数是否定义
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=1').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isDefined与isUndefined
+ - text: 请选择正确的断言—idDefined 或 idUndefined
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=1').then(data => { assert.equal(data.assertions[0].method, 'isDefined', 'Null is not undefined'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isDefined与isUndefined
+ - text: 请选择正确的断言—idDefined 或 idUndefined
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=1').then(data => { assert.equal(data.assertions[1].method, 'isUndefined', 'Undefined is undefined'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isDefined与isUndefined
+ - text: 请选择正确的断言—idDefined 或 idUndefined
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=1').then(data => { assert.equal(data.assertions[2].method, 'isDefined', 'A string is not undefined'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -40,7 +44,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.chinese.md
index f38713a79c..2c6e9870fa 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-array-contains-an-item.chinese.md
@@ -2,15 +2,18 @@
id: 587d824d367417b2b2512c51
title: Test if an Array Contains an Item
challengeType: 2
-videoUrl: ''
+forumTopicId: 301603
localeTitle: 测试数组是否包含项目
---
## Description
-
+
## Instructions
-
+
+使用 assert.include()
或 assert.notInclude()
让所有测试通过。
## Tests
@@ -18,11 +21,11 @@ localeTitle: 测试数组是否包含项目
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=11').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - include与notInclude
+ - text: 请选择正确的断言—include 或 notInclude
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=11').then(data => { assert.equal(data.assertions[0].method, 'notInclude', 'It\'s summer in july...'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - include与notInclude
+ - text: 请选择正确的断言—include 或 notInclude
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=11').then(data => { assert.equal(data.assertions[1].method, 'include', 'JavaScript is a backend language !!'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -38,7 +41,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.chinese.md
index 77e2e3f5d2..5469590b5f 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-has-a-property.chinese.md
@@ -2,15 +2,20 @@
id: 587d824e367417b2b2512c55
title: Test if an Object has a Property
challengeType: 2
-videoUrl: ''
-localeTitle: 测试对象是否具有属性
+forumTopicId: 301604
+localeTitle: 测试对象是否具有某个属性
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 #property断言实际对象具有给定属性。在适当的地方使用#property或#notProperty
+
## Instructions
-
+
+使用 assert.property()
或者 assert.notProperty()
让所有测试通过。
## Tests
@@ -18,13 +23,13 @@ localeTitle: 测试对象是否具有属性
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=15').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - property vs. notProperty
+ - text: 请选择正确的断言—property 或 notProperty
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=15').then(data => { assert.equal(data.assertions[0].method, 'notProperty', 'A car has not wings'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - property vs. notProperty
+ - text: 请选择正确的断言—property 或 notProperty
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=15').then(data => { assert.equal(data.assertions[1].method, 'property', 'planes have engines'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - property vs. notProperty
+ - text: 请选择正确的断言—property 或 notProperty
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=15').then(data => { assert.equal(data.assertions[2].method, 'property', 'Cars have wheels'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -40,7 +45,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.chinese.md
index 4d279c999b..dc3187039a 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-an-object-is-an-instance-of-a-constructor.chinese.md
@@ -2,15 +2,20 @@
id: 587d824e367417b2b2512c57
title: Test if an Object is an Instance of a Constructor
challengeType: 2
-videoUrl: ''
+forumTopicId: 301605
localeTitle: 测试对象是否是构造函数的实例
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 #instanceOf声明对象是构造函数的实例。在适当的地方使用#instanceOf或#notInstanceOf
+
## Instructions
-
+
+使用 assert.instanceOf()
或 assert.notInstanceOf()
让测试通过。
## Tests
@@ -18,15 +23,15 @@ localeTitle: 测试对象是否是构造函数的实例
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=17').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - instanceOf与notInstanceOf
+ - text: 请选择正确的断言—instanceOf 或 notInstanceOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=17').then(data => { assert.equal(data.assertions[0].method, 'notInstanceOf', 'myCar is not an instance of Plane'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - instanceOf与notInstanceOf
+ - text: 请选择正确的断言—instanceOf 或 notInstanceOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=17').then(data => { assert.equal(data.assertions[1].method, 'instanceOf', 'airlinePlane is an instance of Plane'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - instanceOf与notInstanceOf
+ - text: 请选择正确的断言—instanceOf 或 notInstanceOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=17').then(data => { assert.equal(data.assertions[2].method, 'instanceOf', 'everything is an Object in JavaScript...'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - instanceOf与notInstanceOf
+ - text: 请选择正确的断言—instanceOf 或 notInstanceOf
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=17').then(data => { assert.equal(data.assertions[3].method, 'notInstanceOf', 'myCar.wheels is not an instance of String'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +47,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.chinese.md
index 3deff94360..5de1c4a84d 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/test-if-one-value-is-below-or-at-least-as-large-as-another.chinese.md
@@ -2,15 +2,20 @@
id: 587d824c367417b2b2512c4e
title: Test if One Value is Below or At Least as Large as Another
challengeType: 2
-videoUrl: ''
-localeTitle: 测试一个值是否低于或低至另一个值
+forumTopicId: 301606
+localeTitle: 测试一个值是否小于或等于另一个值
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 .isBelow()=> a <b,.isAtLeast => a> = b
+
## Instructions
-
+
+Use assert.isBelow()
(i.e. less than) or assert.isAtLeast()
(i.e. greater than or equal) to make the tests pass.
+使用 assert.isBelow()
(小于)或 assert.isAtLeast()
(大于等于)让所有测试通过。
+
## Tests
@@ -18,15 +23,15 @@ localeTitle: 测试一个值是否低于或低至另一个值
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=8').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isBelow vs. isAtLeast
+ - text: 请选择正确的断言—isBelow 或 isAtLeast
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=8').then(data => { assert.equal(data.assertions[0].method, 'isAtLeast', '5 is at least (>=) 5'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isBelow vs. isAtLeast
+ - text: 请选择正确的断言—isBelow 或 isAtLeast
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=8').then(data => { assert.equal(data.assertions[1].method, 'isAtLeast', '2 * Math.random() is at least 0'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isBelow vs. isAtLeast
+ - text: 请选择正确的断言—isBelow 或 isAtLeast
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=8').then(data => { assert.equal(data.assertions[2].method, 'isBelow', '1 is smaller than 2'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isBelow vs. isAtLeast
+ - text: 请选择正确的断言—isBelow 或 isAtLeast
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=8').then(data => { assert.equal(data.assertions[3].method, 'isBelow', '2/3 (0.6666) is smaller than 1'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +47,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.chinese.md
index cec3a5d44f..cbdb80edd0 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-assert.isok-and-assert.isnotok.chinese.md
@@ -2,15 +2,22 @@
id: 587d824b367417b2b2512c48
title: Use Assert.isOK and Assert.isNotOK
challengeType: 2
-videoUrl: ''
-localeTitle: 使用Assert.isOK和Assert.isNotOK
+forumTopicId: 301607
+localeTitle: 使用 Assert.isOk() 和 Assert.isNotOK()
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。使用assert.isOk()或assert.isNotOk()来使测试通过。 .isOk(truthy)和.isNotOk(falsey)将通过。
+
+请注意,本项目在 这个 Repl.it 项目 的基础上进行开发。你也可以从 GitHub 上克隆。
+
+isOk()
用来测试值是否为 truthy
;isNotOk()
用来测试值是否为 falsy
。
+如果你想了解更多关于 truthy 和 falsy 值的内容,请参阅 Falsy Bouncer 这道挑战题目。
+
## Instructions
-
+
+
+使用 assert.isOk()
或 assert.isNotOk()
让测试通过。
## Tests
@@ -18,13 +25,13 @@ localeTitle: 使用Assert.isOK和Assert.isNotOK
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isOk vs. isNotOk
+ - text: 请选择正确的断言—isOk 或 isNotOk
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => { assert.equal(data.assertions[0].method, 'isNotOk', 'Null is falsy'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isOk vs. isNotOk
+ - text: 请选择正确的断言—isOk 或 isNotOk
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => { assert.equal(data.assertions[1].method, 'isOk','A string is truthy'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - isOk vs. isNotOk
+ - text: 请选择正确的断言—isOk 或 isNotOk
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=2').then(data => { assert.equal(data.assertions[2].method, 'isOk', 'true is truthy'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -40,7 +47,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.chinese.md
index 3b031a9932..27a9f8d8ee 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-regular-expressions-to-test-a-string.chinese.md
@@ -2,15 +2,20 @@
id: 587d824d367417b2b2512c54
title: Use Regular Expressions to Test a String
challengeType: 2
-videoUrl: ''
+forumTopicId: 301608
localeTitle: 使用正则表达式测试字符串
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 #match断言实际值与第二个参数正则表达式匹配。
+
## Instructions
-
+
+使用 assert.match()
让所有测试通过。
+
## Tests
@@ -18,11 +23,11 @@ localeTitle: 使用正则表达式测试字符串
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=14').then(data => { assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - 匹配与非匹配
+ - text: 请选择正确的断言—match 或 notMatch
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=14'').then(data => { assert.equal(data.assertions[0].method, ''match'', ''\''# name: John Doe, age: 35\'' matches the regex''); }, xhr => { throw new Error(xhr.responseText); })'
- - text: 选择正确的断言 - 匹配与非匹配
+ - text: 请选择正确的断言—match 或 notMatch
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/get-tests?type=unit&n=14'').then(data => { assert.equal(data.assertions[1].method, ''notMatch'', ''\''# name: Paul Smith III, age: twenty-four\'' does not match the regex (the age must be numeric)''); }, xhr => { throw new Error(xhr.responseText); })'
```
@@ -38,7 +43,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.chinese.md
index 99ced1dfeb..6bb80e3438 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-double-equals-to-assert-equality.chinese.md
@@ -2,15 +2,20 @@
id: 587d824b367417b2b2512c4a
title: Use the Double Equals to Assert Equality
challengeType: 2
-videoUrl: ''
-localeTitle: 使用Double Equals来断言平等
+forumTopicId: 301609
+localeTitle: 用两个等号断言相等
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 .equal(),. notEqual().equal()使用'=='比较对象
+
## Instructions
-
+
+使用 assert.equal()
或 assert.notEqual()
让所有测试通过。
+
## Tests
@@ -18,15 +23,15 @@ localeTitle: 使用Double Equals来断言平等
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=4').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - 相等与不等
+ - text: 请选择正确的断言—equal 或 notEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=4').then(data => { assert.equal(data.assertions[0].method, 'equal', 'Numbers are coerced into strings with == '); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - 相等与不等
+ - text: 请选择正确的断言—equal 或 notEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=4').then(data => { assert.equal(data.assertions[1].method, 'notEqual', ' == compares object references'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - 相等与不等
+ - text: 请选择正确的断言—equal 或 notEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=4').then(data => { assert.equal(data.assertions[2].method, 'equal', '6 * \'2\' is 12 ! It should be equal to \'12\''); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - 相等与不等
+ - text: 请选择正确的断言—equal 或 notEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=4').then(data => { assert.equal(data.assertions[3].method, 'notEqual', '6 + \'2\' is \'62\'...'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +47,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+
diff --git a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.chinese.md b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.chinese.md
index e31f8c0892..8375aeb21f 100644
--- a/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.chinese.md
+++ b/curriculum/challenges/chinese/06-quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality.chinese.md
@@ -2,15 +2,20 @@
id: 587d824b367417b2b2512c4b
title: Use the Triple Equals to Assert Strict Equality
challengeType: 2
-videoUrl: ''
-localeTitle: 使用Triple Equals断言严格平等
+forumTopicId: 301610
+localeTitle: 用三个等号断言严格相等
---
## Description
-提醒一下,这个项目是基于Glitch的以下入门项目构建的,或者是从GitHub克隆的。 .strictEqual(),. notStrictEqual()。sqleEqual()使用'==='比较对象
+
## Instructions
-
+
+使用 assert.strictEqual()
或 assert.notStrictEqual()
让所有测试通过。
+
## Tests
@@ -18,15 +23,15 @@ localeTitle: 使用Triple Equals断言严格平等
```yml
tests:
- - text: 所有测试都应该通过
+ - text: 不应有未通过的测试
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=5').then(data => {assert.equal(data.state,'passed'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - strictEqual vs. notStrictEqual
+ - text: 请选择正确的断言—strictEqual 或 notStrictEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=5').then(data => { assert.equal(data.assertions[0].method, 'notStrictEqual', 'with strictEqual the type must match'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - strictEqual vs. notStrictEqual
+ - text: 请选择正确的断言—strictEqual 或 notStrictEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=5').then(data => { assert.equal(data.assertions[1].method, 'strictEqual', '3*2 = 6...'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - strictEqual vs. notStrictEqual
+ - text: 请选择正确的断言—strictEqual 或 notStrictEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=5').then(data => { assert.equal(data.assertions[2].method, 'strictEqual', '6 * \'2\' is 12. Types match !'); }, xhr => { throw new Error(xhr.responseText); })
- - text: 选择正确的断言 - strictEqual vs. notStrictEqual
+ - text: 请选择正确的断言—strictEqual 或 notStrictEqual
testString: getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=5').then(data => { assert.equal(data.assertions[3].method, 'notStrictEqual', 'Even if they have the same elements, the Arrays are notStrictEqual'); }, xhr => { throw new Error(xhr.responseText); })
```
@@ -42,7 +47,11 @@ tests:
```js
-// solution required
+/**
+ Backend challenges don't need solutions,
+ because they would need to be tested against a full working project.
+ Please check our contributing guidelines to learn more.
+*/
```
-/section>
+