Better russian language (#37542)

This commit is contained in:
Gregory
2020-01-24 09:45:53 +04:00
committed by Gregory Gubarev
parent 103eac7540
commit dd9485f27c

View File

@ -8,12 +8,12 @@ localeTitle: Запуск функциональных тестов при от
## Description ## Description
<section id='description'> <section id='description'>
Напомним, что этот проект строится на следующем стартовом проекте <a href="https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/">Glitch</a> или клонируется из <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/">GitHub</a> . В следующем примере мы увидим, как отправлять данные в полезную нагрузку (тело) запроса. Мы собираемся протестировать запрос PUT. Конечная точка «/ путешественников» принимает объект JSON, который принимает структуру: {фамилия: [фамилия путешественника прошлого]}. Маршрут отвечает: {name: [имя], фамилия: [фамилия], даты : [birth - death years]} см. код сервера для получения более подробной информации. Отправить {фамилия: «Коломбо»}. Замените assert.fail () и выполните тестовый проход. Проверить 1) статус, 2) тип, 3) body.name, 4) body.surname Следуйте приведенному выше порядку утверждения, мы полагаемся на него. Напомним, что этот проект строится на следующем стартовом проекте <a href="https://glitch.com/#!/import/github/freeCodeCamp/boilerplate-mochachai/">Glitch</a> или клонируется из <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/">GitHub</a> . В следующем примере мы увидим, как отправлять данные в полезную нагрузку (тело) запроса. Мы собираемся протестировать запрос PUT. Конечная точка «/ путешественников» принимает объект JSON, который принимает структуру: {фамилия: [фамилия путешественника прошлого]}. Маршрут отвечает: {name: [имя], фамилия: [фамилия], даты : [годы рождения-смерти]} см. код сервера для получения более подробной информации. Отправить {фамилия: «Коломбо»}. Замените assert.fail () и выполните тестовый проход. Проверить 1) статус, 2) тип, 3) body.name, 4) body.surname Следуйте приведенному выше порядку утверждения, мы полагаемся на него.
</section> </section>
## Instructions ## Instructions
<section id='instructions'> <section id='instructions'>
Send <br> Отправьте <br>
```json ```json
{ {
@ -21,9 +21,9 @@ Send <br>
} }
``` ```
Replace <code>assert.fail()</code> and make the test pass. Замените <code>assert.fail()</code> и пройдите тест.
Check for 1) <code>status</code>, 2) <code>type</code>, 3) <code>body.name</code>, 4) <code>body.surname</code>. Проверьте на 1) <code>status</code>, 2) <code>type</code>, 3) <code>body.name</code>, 4) <code>body.surname</code>.
Follow the assertion order above, We rely on it. Следуйте порядку утверждения выше, мы полагаемся на это.
</section> </section>
## Tests ## Tests
@ -31,15 +31,15 @@ Follow the assertion order above, We rely on it.
```yml ```yml
tests: tests:
- text: All tests should pass - 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); }) 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: You should test for 'res.status' to be 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); }) 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: You should test for 'res.type' to be 'application/json' - 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); }) 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: You should test for 'res.body.name' to be 'Cristoforo' - 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); }) 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: You should test for 'res.body.surname' to be 'Colombo' - 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.equal(data.assertions[3].args[1], '\'Colombo\'');}, xhr => { throw new Error(xhr.responseText); }) 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); })
``` ```