chore(i18n,curriculum): processed translations (#42115)

This commit is contained in:
camperbot
2021-05-12 21:25:58 +05:30
committed by GitHub
parent 7f8f4dad63
commit 7aaa365393
86 changed files with 194 additions and 186 deletions

View File

@@ -11,7 +11,7 @@ dashedName: exercise-tracker
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似: <https://exercise-tracker.freecodecamp.rocks/>。 可以採用下面的一種方式完成這個挑戰:
- 克隆 [GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/) 並在本地完成你的項目。
- 使用 [repl.it 初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-exercisetracker) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-exercisetracker)來完成你的項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
@@ -29,12 +29,12 @@ dashedName: exercise-tracker
};
```
可以將表單裏的 `username` 通過 `POST` 請求發送到 `/api/exercise/new-user`,以創建一個新的用戶。 返回的響應內容是一個帶有 `username``_id` 的對象
可以將表單裏的 `username` 通過 `POST` 請求發送到 `/api/users`,以創建一個新的用戶。 返回的響應內容是一個帶有 `username``_id` 的對象
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
@@ -49,12 +49,12 @@ async (getUserInput) => {
};
```
可以發送 `GET` 請求到 `api/exercise/users`,以獲取一個所有用戶的數組, 數組裏的每個元素都是一個包含 `username``_id` 的用戶對象。
可以發送 `GET` 請求到 `/api/users`,以獲取一個所有用戶的數組, 數組裏的每個元素都是一個包含 `username``_id` 的用戶對象。
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/users');
const res = await fetch(url + '/api/users');
if (res.ok) {
const data = await res.json();
assert.isArray(data);
@@ -66,12 +66,12 @@ async (getUserInput) => {
};
```
你能用表單裏的 `userId=_id``description``duration``date`(可選)發送 `POST` 請求到 `/api/exercise/add`。 如果沒有傳入 date默認採用當前日期。 響應內容是包含 exercise 表單內容的 user 對象。
你能用表單裏的 `description``duration``date`(可選)發送 `POST` 請求到 `/api/users/:_id/exercises`。 如果沒有傳入 date默認採用當前日期。 響應內容是包含 exercise 表單內容的 user 對象。
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
@@ -85,10 +85,10 @@ async (getUserInput) => {
_id,
date: 'Mon Jan 01 1990'
};
const addRes = await fetch(url + '/api/exercise/add', {
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
});
if (addRes.ok) {
const actual = await addRes.json();
@@ -102,12 +102,12 @@ async (getUserInput) => {
};
```
可以 `/api/exercise/log` 發送參數爲 `userId=_id``GET` 請求,並檢索全部的 exercise 日誌。 響應內容是一個 user 對象,它帶有一個 `log` 屬性,該屬性的值是所有被添加的 exercises 表單記錄組成的數組, 每一個 log 數組裏的元素應該是一個含有 `description``duration``date` 等屬性的對象。
可以發送 `GET` 請求到 `/api/users/:_id/logs`,以獲取任何用戶的完整 exercise 日誌。 響應內容是一個 user 對象,它帶有一個 `log` 屬性,該屬性的值是所有被添加的 exercises 表單記錄組成的數組, 每一個 log 數組裏的元素應該是一個含有 `description``duration``date` 等屬性的對象。
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
@@ -121,13 +121,13 @@ async (getUserInput) => {
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + '/api/exercise/add', {
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}`
body: `description=${expected.description}&duration=${expected.duration}`
});
if (addRes.ok) {
const logRes = await fetch(url + `/api/exercise/log?userId=${_id}`);
const logRes = await fetch(url + `/api/users/${_id}/logs`);
if (logRes.ok) {
const { log } = await logRes.json();
assert.isArray(log);
@@ -144,12 +144,12 @@ async (getUserInput) => {
};
```
用戶日誌請求 (`/api/exercise/log`) 返回一個帶有 `count` 屬性的對象,該屬性反映 exercises 表單的成功提交次數(譯者注:即 log 屬性元素的個數)。
用戶日誌請求`/api/users/:_id/logs`返回一個帶有 `count` 屬性的對象,該屬性反映 exercises 表單的成功提交次數(譯者注:即 log 屬性元素的個數)。
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
@@ -163,13 +163,13 @@ async (getUserInput) => {
_id,
date: new Date().toDateString()
};
const addRes = await fetch(url + '/api/exercise/add', {
const addRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}`
body: `description=${expected.description}&duration=${expected.duration}`
});
if (addRes.ok) {
const logRes = await fetch(url + `/api/exercise/log?userId=${_id}`);
const logRes = await fetch(url + `/api/users/${_id}/logs`);
if (logRes.ok) {
const { count } = await logRes.json();
assert(count);
@@ -185,12 +185,12 @@ async (getUserInput) => {
};
```
可以把 `from``to``limit` 參數添加到 `/api/exercise/log` 請求,以查詢該用戶的部分 exercise 表單提交記錄, `from``to``yyyy-mm-dd` 形式的日期, `limit` 是希望返回的 log 數量。
可以把 `from``to``limit` 參數添加到一個 `/api/users/:_id/logs` 請求,以查詢該用戶的部分 exercise 表單提交記錄, `from``to``yyyy-mm-dd` 形式的日期, `limit` 是希望返回的 log 數量。
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/exercise/new-user', {
const res = await fetch(url + '/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `username=fcc_test_${Date.now()}`.substr(0, 29)
@@ -204,19 +204,19 @@ async (getUserInput) => {
_id,
date: new Date().toDateString()
};
const addExerciseRes = await fetch(url + '/api/exercise/add', {
const addExerciseRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-01`
});
const addExerciseTwoRes = await fetch(url + '/api/exercise/add', {
const addExerciseTwoRes = await fetch(url + `/api/users/${_id}/exercises`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `userId=${_id}&description=${expected.description}&duration=${expected.duration}&date=1990-01-02`
body: `description=${expected.description}&duration=${expected.duration}&date=1990-01-02`
});
if (addExerciseRes.ok && addExerciseTwoRes.ok) {
const logRes = await fetch(
url + `/api/exercise/log?userId=${_id}&from=1989-12-31&to=1990-01-03`
url + `/api/users/${_id}/logs?from=1989-12-31&to=1990-01-03`
);
if (logRes.ok) {
const { log } = await logRes.json();
@@ -226,7 +226,7 @@ async (getUserInput) => {
throw new Error(`${logRes.status} ${logRes.statusText}`);
}
const limitRes = await fetch(
url + `/api/exercise/log?userId=${_id}&limit=1`
url + `/api/users/${_id}/logs?limit=1`
);
if (limitRes.ok) {
const { log } = await limitRes.json();

View File

@@ -11,7 +11,7 @@ dashedName: file-metadata-microservice
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://file-metadata-microservice.freecodecamp.rocks/>。 可以採用下面的一種方式完成這個挑戰:
- 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) 並在本地完成項目。
- 使用 [repl.it 初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-filemetadata) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-filemetadata)來完成你的項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。

View File

@@ -11,7 +11,7 @@ dashedName: request-header-parser-microservice
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://request-header-parser-microservice.freecodecamp.rocks/>。 可以採用下面的一種方式完成這個挑戰:
- 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-headerparser/) 並在本地完成項目。
- 使用 [repl.it 初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-headerparser) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-headerparser)來完成你的項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。

View File

@@ -11,7 +11,7 @@ dashedName: timestamp-microservice
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://timestamp-microservice.freecodecamp.rocks/>。 可以採用下面的任意一種方式完成這個挑戰:
- 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-timestamp/) 並在本地完成項目。
- 使用 [repl.it 初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-timestamp) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-timestamp)來完成你的項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
@@ -28,11 +28,11 @@ dashedName: timestamp-microservice
};
```
`/api/timestamp/:date?` 發送一個帶有有效日期的請求,應該很快(在幾毫秒內)返回一個 JSON 對象,在這個 JSON 對象內有一個包含輸入日期的 Unix 時間戳的 `unix` 鍵。
`/api/:date?` 發送一個帶有有效日期的請求,應該很快(在幾毫秒內)返回一個 JSON 對象,在這個 JSON 對象內有一個包含輸入日期的 Unix 時間戳的 `unix` 鍵。
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/timestamp/2016-12-25').then(
$.get(getUserInput('url') + '/api/2016-12-25').then(
(data) => {
assert.equal(
data.unix,
@@ -46,11 +46,11 @@ dashedName: timestamp-microservice
);
```
`/api/timestamp/:date?` 發送一個帶有有效日期的請求,應該返回一個 JSON 對象,在這個 JSON 對象內有一個包含如 `Thu, 01 Jan 1970 00:00:00 GMT` 格式的輸入日期的 `utc` 鍵。
`/api/:date?` 發送一個帶有有效日期的請求,應該返回一個 JSON 對象,在這個 JSON 對象內有一個包含如 `Thu, 01 Jan 1970 00:00:00 GMT` 格式的輸入日期的 `utc` 鍵。
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/timestamp/2016-12-25').then(
$.get(getUserInput('url') + '/api/2016-12-25').then(
(data) => {
assert.equal(
data.utc,
@@ -64,11 +64,11 @@ dashedName: timestamp-microservice
);
```
`/api/timestamp/1451001600000` 發送請求,應該返回 `{ unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" }`
`/api/1451001600000` 發送請求,應該返回 `{ unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" }`
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/timestamp/1451001600000').then(
$.get(getUserInput('url') + '/api/1451001600000').then(
(data) => {
assert(
data.unix === 1451001600000 &&
@@ -85,7 +85,7 @@ dashedName: timestamp-microservice
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/timestamp/05 October 2011').then(
$.get(getUserInput('url') + '/api/05 October 2011').then(
(data) => {
assert(
data.unix === 1317772800000 &&
@@ -102,7 +102,7 @@ dashedName: timestamp-microservice
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/timestamp/this-is-not-a-date').then(
$.get(getUserInput('url') + '/api/this-is-not-a-date').then(
(data) => {
assert.equal(data.error.toLowerCase(), 'invalid date');
},
@@ -116,7 +116,7 @@ dashedName: timestamp-microservice
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/timestamp').then(
$.get(getUserInput('url') + '/api').then(
(data) => {
var now = Date.now();
assert.approximately(data.unix, now, 20000);
@@ -131,7 +131,7 @@ dashedName: timestamp-microservice
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/timestamp').then(
$.get(getUserInput('url') + '/api').then(
(data) => {
var now = Date.now();
var serverTime = new Date(data.utc).getTime();

View File

@@ -11,7 +11,7 @@ dashedName: url-shortener-microservice
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://url-shortener-microservice.freecodecamp.rocks/>。 可以採用下面的任意一種方式完成這個挑戰:
- 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-filemetadata/) 並在本地完成項目。
- 使用 [repl.it 初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-urlshortener) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-urlshortener)來完成你的項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
@@ -34,14 +34,14 @@ dashedName: url-shortener-microservice
};
```
可以通過 POST 請求給 `/api/shorturl/new` 發送一個 URL並返回一個帶有 `original_url``short_url` 屬性的 JSON 響應 例如:`{ original_url : 'https://freeCodeCamp.org', short_url : 1}`
可以通過 POST 請求給 `/api/shorturl` 發送一個 URL並返回一個帶有 `original_url``short_url` 屬性的 JSON 響應 例如:`{ original_url : 'https://freeCodeCamp.org', short_url : 1}`
```js
async (getUserInput) => {
const url = getUserInput('url');
const urlVariable = Date.now();
const fullUrl = `${url}/?v=${urlVariable}`
const res = await fetch(url + '/api/shorturl/new/', {
const res = await fetch(url + '/api/shorturl', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `url=${fullUrl}`
@@ -64,7 +64,7 @@ async (getUserInput) => {
const urlVariable = Date.now();
const fullUrl = `${url}/?v=${urlVariable}`
let shortenedUrlVariable;
const postResponse = await fetch(url + '/api/shorturl/new/', {
const postResponse = await fetch(url + '/api/shorturl', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `url=${fullUrl}`
@@ -93,7 +93,7 @@ async (getUserInput) => {
```js
async (getUserInput) => {
const url = getUserInput('url');
const res = await fetch(url + '/api/shorturl/new/', {
const res = await fetch(url + '/api/shorturl', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `url=ftp:/john-doe.org`

View File

@@ -11,14 +11,14 @@ dashedName: meet-the-node-console
可以採用下面的任意一種方式完成這些挑戰:
- 克隆 [這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-express/) 並在本地完成項目。
- 使用 [Repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-express) 來完成項目。
- 使用[我們的 Repl.it 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-express)來完成項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。
在開發過程中,能夠隨時看到代碼的運行結果是非常重要的。
Node 只是一個 JavaScript 環境。 與客戶端 JavaScript 一樣,你可以使用控制檯顯示有用的調試信息。 在本地計算機上,你可以在終端中輸出調試信息。 在 Repl.it 上,右側邊欄會默認打開一個終端。
Node 只是一個 JavaScript 環境。 與客戶端 JavaScript 一樣,你可以使用控制檯顯示有用的調試信息。 在本地計算機上,你可以在終端中輸出調試信息。 在 Replit 上,右側邊欄會默認打開一個終端。
我們建議在做這些挑戰題時保持終端打開的狀態。 通過這些終端的輸出,你可能會發現這些錯誤的本質原因。

View File

@@ -22,7 +22,7 @@ function(req, res) {
# --instructions--
當 GET 請求 `/`(根路由 )時,使用 `app.get()` 方法響應一個“Hello Express”字符串。 通過查看日誌確保代碼正常運行,如果使用 Repl.it 可以在預覽中查看結果。
當 GET 請求 `/`(根路由 )時,使用 `app.get()` 方法響應一個“Hello Express”字符串。 通過查看日誌確保代碼正常運行,如果使用 Replit 可以在預覽中查看結果。
**注意:** 這些課程的所有代碼應該放在開始給出的幾行代碼之間。

View File

@@ -16,11 +16,15 @@ dashedName: use-the--env-file
添加一個環境變量作爲配置選項。
在項目根目錄創建一個 `.env` 文件,並存儲變量 `MESSAGE_STYLE=uppercase` 當向 `/json` 發 GET 請求時,如果 `process.env.MESSAGE_STYLE` 的值爲 `uppercase`,那麼上一次挑戰中的路由處理程序返回的對象的消息則應該大寫, 即響應對象應該是 `{"message": "HELLO JSON"}`
在項目根目錄創建一個 `.env` 文件,並存儲變量 `MESSAGE_STYLE=uppercase`
當向 `/json` 發 GET 請求時,如果 `process.env.MESSAGE_STYLE` 的值爲 `uppercase`,那麼上一次挑戰中的路由處理程序返回的對象的消息則應該大寫。 響應對象應該是 `{"message": "Hello json"}` or `{"message": "HELLO JSON"}`,取決於 `MESSAGE_STYLE` 的值。
**注意:**如果你正在使用 Replit你無法創建一個 `.env` 文件。 相反,使用內置的 <dfn>SECRETS</dfn> 標籤添加變量。
# --hints--
端口 `/json` 響應的值,應該隨着環境變量 `MESSAGE_STYLE` 的變化而改變
端口 `/json` 響應的值,應該隨着環境變量 `MESSAGE_STYLE` 的變化而改變
```js
(getUserInput) =>

View File

@@ -11,7 +11,7 @@ dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-packa
可以採用下面的任意一種方式完成這些挑戰:
- 克隆 [GitHub repo](https://github.com/freeCodeCamp/boilerplate-npm/) 並在本地完成項目。
- 使用 [Repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-npm) 來完成項目。
- 使用[我們的 Replit 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-npm)來完成項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。

View File

@@ -12,7 +12,7 @@ dashedName: create-a-model
首先,我們需要一個 Schema 每一個 Schema 都對應一個 MongoDB 的 collection 並且在相應的 collection 裏定義 documents 的“樣子”。 Schema 用於組成模型Model 我們甚至可以通過嵌套 Schema 來創建複雜的模型。目前我們先從簡。 我們可以根據模型創建實例,模型實例化後的對象稱爲 documents。
Repl.it 是一個真實的服務器。正式的服務通過 handler 函數和數據庫交互。 這些函數會在特定事件(比如有人調用了我們的服務器 API發生時執行。 接下來的挑戰題目即是以此爲基礎。 `done()` 是一個回調函數,它的作用是在一個異步操作(比如對數據庫進行插入、查詢、更新或刪除)執行完成時,通知我們可以繼續執行後續的其它代碼。 這與 Node.js 中的處理方式十分類似,在 Node.js 中,我們會在(異步操作)成功時調用 `done(null, data)`,在失敗時調用 `done(err)`
Replit 是一個真實的服務器,在其中,通過 handler 函數和數據庫交互。 這些函數會在特定事件(比如有人調用了我們的服務器 API發生時執行。 接下來的挑戰題目即是以此爲基礎。 `done()` 是一個回調函數,它的作用是在一個異步操作(比如對數據庫進行插入、查詢、更新或刪除)執行完成時,通知我們可以繼續執行後續的其它代碼。 這與 Node.js 中的處理方式十分類似,在 Node.js 中,我們會在(異步操作)成功時調用 `done(null, data)`,在失敗時調用 `done(err)`
注意:與遠程服務器進行交互時,我們需要考慮到發生錯誤的可能!

View File

@@ -11,7 +11,7 @@ dashedName: install-and-set-up-mongoose
可以採用下面的任意一種方式完成這些挑戰:
- 克隆 [GitHub repo](https://github.com/freeCodeCamp/boilerplate-mongomongoose/) 並在本地完成項目。
- 使用 [Repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-mongomongoose)來完成項目。
- 使用[我們的 Replit 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-mongomongoose)來完成項目。
- 使用你選擇的網站生成器來完成項目, 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個正常運行的 demo 可以公開訪問。 然後將 URL 提交到 `Solution Link` 中。

View File

@@ -18,7 +18,7 @@ dashedName: implementation-of-social-authentication
在 OAuth 驗證策略中,我們至少需要提供 *Client ID**Client Secret*,這樣第三方平臺就會獲悉驗證請求的來源,以及這個來源是否有效。 爲此,需要去我們使用的第三方驗證平臺(比如 GitHub獲取這兩個字段的值。 注意,我們獲取到的這個值是唯一的,僅對我們的當前 app 有效——**因此,千萬不要分享給別人**,更不要上傳到公共倉庫或者直接寫在代碼裏。 通常,我們會把它們放在 `.env` 文件裏,並通過 `process.env.GITHUB_CLIENT_ID` 獲取。 對於這次挑戰,我們將會使用 GitHub 作爲驗證平臺。
首先,你需要進入賬戶設置裏的 “developer settings開發者設置”板塊在 '[OAuth applications](https://github.com/settings/developers)' 獲取 *Client ID and Secret*。 點擊 “Register a new application”設置你的應用名稱然後把你的 Repl.it 主頁地址(**不是項目代碼的地址**)粘貼到 Homepage URL。然後回調 url 需要設置成上面 Homepage URL 裏你粘貼的地址,但後面要加上 `/auth/github/callback`。 這樣在用戶通過 Github 驗證後才能跳轉到我們指定的頁面。 在你的 `.env` 文件裏將返回的信息保存爲 `'GITHUB_CLIENT_ID'``'GITHUB_CLIENT_SECRET'`
首先,你需要進入賬戶設置裏的 “developer settings開發者設置”板塊在 '[OAuth applications](https://github.com/settings/developers)' 獲取 *Client ID and Secret*。 點擊 “Register a new application(註冊一個新的應用)”,設置你的應用名稱,然後把你的 Replit 主頁地址(**不是項目代碼的 url**)粘貼到 Homepage URL。然後回調 url 需要設置成上面 Homepage URL 裏你粘貼的地址,但後面要加上 `/auth/github/callback`。 這樣在用戶通過 Github 驗證後才能跳轉到我們指定的頁面。 在你的 `.env` 文件裏將返回的信息保存爲 `'GITHUB_CLIENT_ID'``'GITHUB_CLIENT_SECRET'`
在你的 `routes.js` 文件中,添加 `showSocialAuth: true` 到主頁路由,在 `showRegistration: true` 的後面。 然後,爲 `/auth/github``/auth/github/callback` 創建兩個接收 GET 請求的路由。 第一個只需要通過調用 passport 來驗證 `'github'`。 第二個應該調用 passport 來驗證 `'github'`,但需要在失敗時跳轉回主頁 `/`,成功時跳轉到用戶頁面 `/profile`(跳轉的邏輯與上一個項目中的邏輯一樣)。

View File

@@ -11,7 +11,7 @@ dashedName: set-up-a-template-engine
你可以採用下面的任意一種方式完成這些挑戰:
- 克隆[這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-advancednode/),在本地完成這些挑戰。
- 使用[我們 Repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-advancednode)來完成這些挑戰
- 使用[我們 Replit 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-advancednode)來完成項目
- 使用一個你選擇的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
完成本項目後,請將一個正常運行的 demo項目演示託管在可以公開訪問的平臺。 然後在 `Solution Link` 框中提交你的項目 URL。

View File

@@ -8,7 +8,7 @@ dashedName: assert-deep-equality-with--deepequal-and--notdeepequal
# --description--
請注意,本項目在 [這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 的基礎上進行開發。 你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`deepEqual()` 斷言兩個對象是否深度相等。

View File

@@ -8,7 +8,7 @@ dashedName: compare-the-properties-of-two-elements
# --description--
請注意,本項目在 [這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 的基礎上進行開發。 你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
# --instructions--

View File

@@ -11,7 +11,7 @@ dashedName: learn-how-javascript-assertions-work
你可以採用下面的任意一種方式完成這些挑戰:
- 克隆[這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-mochachai/)並在本地完成項目。
- 使用[我們 Repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)來完成這些挑戰
- 使用[我們 Replit 上的初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)來完成項目
- 使用一個你喜歡的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
完成本項目後,請將一個正常運行的 demo項目演示託管在可以公開訪問的平臺。 然後在 `Solution Link` 框中提交你的項目 URL。

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iii---put-me
# --description--
請注意,本項目在 [這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
接下來,我們將瞭解如何使用請求的 payloadbody發送數據。 我們需要測試一個 PUT 請求, `'/travellers'` 接收如下的 JSON 對象:

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iv---put-met
# --description--
請注意,本項目在 [這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。 這個練習與上一個類似, 我們詳細看看。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。 這個練習與上一個類似, 我們詳細看看。
你已經看到了它是如何完成的,現在你需要從零開始搭建。

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http-ii
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。 你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
# --instructions--

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
Mocha 允許測試異步操作。 有一個差異, 你能發現它嗎?

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-using-a-headless-browser-ii
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
# --instructions--

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-using-a-headless-browser
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。 你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
在 HTML 主視圖中有一個輸入表格。 它發送數據到 `PUT /travellers` 端點,我們在上面的 Ajax 請求中使用。 當請求成功完成時,客戶端代碼會給 DOM 增加一個包含調用返回信息的 `<div>`。 下面的例子展示瞭如何使用這個表格:
@@ -18,7 +18,7 @@ test('#test - submit the input "surname" : "Polo"', function (done) {
browser.assert.success();
browser.assert.text('span#name', 'Marco');
browser.assert.text('span#surname', 'Polo');
browser.assert.element('span#dates', 1);
browser.assert.elements('span#dates', 1);
done();
});
}
@@ -119,7 +119,7 @@ test('#test - submit the input "surname" : "Polo"', function (done) {
(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].method, 'browser.elements');
assert.match(data.assertions[3].args[0], /('|")span#dates\1/);
assert.equal(data.assertions[3].args[1], 1);
},

View File

@@ -7,13 +7,13 @@ dashedName: simulate-actions-using-a-headless-browser
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
在接下來的挑戰中,我們將使用名爲 “Headless Browser無頭瀏覽器” 的設備模擬人與頁面的交互。
無頭瀏覽器是沒有圖形用戶界面的 Web 瀏覽器。 這種工具對於測試網頁特別有用,因爲它能夠以與瀏覽器相同的方式呈現和理解 HTML、CSS 和 JavaScript。
針對這些挑戰,我們使用 Zombie.JS。 它是一個輕量級瀏覽器,完全基於 JS而不需要額外的二進制文件來安裝。 這個功能使我們可以在 Repl.it 等環境中使用它。 還有許多其他(更強大的)選擇。
針對這些挑戰,我們使用 Zombie.JS。 它是一個輕量級瀏覽器,完全基於 JS而不需要額外的二進制文件來安裝。 這個特性使我們可以在 Replit 等環境中使用它。 還有許多其他(更強大的)選擇。
Mocha 允許你在實際測試之前準備一些代碼運行的基礎。 這可能有助於例如在數據庫中創建項目,用於連續測試。

View File

@@ -8,7 +8,7 @@ dashedName: test-for-truthiness
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`isTrue()` 僅當給出的值爲 Boolean 的 `true` 時可以通過測試;`isNotTrue()` 則會在給出除 `true` 以外的值時通過測試。

View File

@@ -8,7 +8,7 @@ dashedName: test-if-a-string-contains-a-substring
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`include()``notInclude()` 同樣可以用於字符串。 `include()` 用於斷言字符串中包含某個子字符串。

View File

@@ -8,7 +8,7 @@ dashedName: test-if-a-value-falls-within-a-specific-range
# --description--
請注意,本項目在 [這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 的基礎上進行開發。 你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
```javascript
.approximately(actual, expected, delta, [message])

View File

@@ -8,7 +8,7 @@ dashedName: test-if-a-value-is-a-string
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`isString``isNotString` 斷言一個值是否爲字符串。

View File

@@ -8,7 +8,7 @@ dashedName: test-if-a-value-is-an-array
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
# --instructions--

View File

@@ -8,7 +8,7 @@ dashedName: test-if-a-value-is-of-a-specific-data-structure-type
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`#typeOf` 斷言一個值的類型符合給定的類型,這個類型與 `Object.prototype.toString` 一致。

View File

@@ -8,7 +8,7 @@ dashedName: test-if-a-variable-or-function-is-defined
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
# --instructions--

View File

@@ -8,7 +8,7 @@ dashedName: test-if-an-array-contains-an-item
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
# --instructions--

View File

@@ -8,7 +8,7 @@ dashedName: test-if-an-object-has-a-property
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`property` 斷言一個對象含有給定屬性。

View File

@@ -8,7 +8,7 @@ dashedName: test-if-an-object-is-an-instance-of-a-constructor
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`#instanceOf` 斷言一個對象是一個構造器的實例。

View File

@@ -8,7 +8,7 @@ dashedName: test-if-one-value-is-below-or-at-least-as-large-as-another
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
# --instructions--

View File

@@ -8,7 +8,7 @@ dashedName: use-assert-isok-and-assert-isnotok
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`isOk()` 用來測試值是否爲真值,`isNotOk()` 用來測試值是否爲假值。

View File

@@ -8,7 +8,7 @@ dashedName: use-regular-expressions-to-test-a-string
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`match()` 斷言一個值匹配一個正則表達式(第二個參數)。

View File

@@ -8,7 +8,7 @@ dashedName: use-the-double-equals-to-assert-equality
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`equal()` 使用 `==` 比較對象。

View File

@@ -8,7 +8,7 @@ dashedName: use-the-triple-equals-to-assert-strict-equality
# --description--
請注意,本項目在[這個 Repl.it 項目](https://repl.it/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
請注意,本項目在[這個 Replit 項目](https://replit.com/github/freeCodeCamp/boilerplate-mochachai)的基礎上進行開發。你也可以從 [GitHub](https://repl.it/github/freeCodeCamp/boilerplate-mochachai) 上克隆。
`strictEqual()` 使用 `===` 比較對象。

View File

@@ -10,7 +10,7 @@ dashedName: american-british-translator
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://american-british-translator.freecodecamp.rocks/>。 可以採用下面的任意一種方式完成這個挑戰:
- 克隆 [這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/) 並在本地完成項目。
- 使用 [repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-american-british-english-translator) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator)來完成你的項目。
- 使用您選擇的站點生成器來完成項目。 並確保包含了我們 GitHub 倉庫的所有文件。
當完成本項目,請確認有一個可以公開訪問的正常運行 demo 。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
@@ -21,8 +21,8 @@ dashedName: american-british-translator
-`/routes/api.js` 中完成 `/api/translate` 路由
-`tests/1_unit-tests.js``tests/2_functional-tests.js` 中創建所有 unit/functional 測試
- 查看 `/components` 中的 JavaScript 文件以獲取應用程序應該翻譯的條款以及不同的拼寫
-`.env` 文件中將 `NODE_ENV` 設置爲 `test`(沒有引號),運行 Repl.it 上測試。
- 使用 `npm run test` 命令,在 console 運行測試。 按 Ctrl+Shift+P (在 Mac 上是 Cmd+Shift+P) 並輸入"open shell",打開 Repl.it 控制檯。
-`.env` 文件中將 `NODE_ENV` 設置爲 `test`(沒有引號), Replit 上運行測試。
- 使用 `npm run test` 命令,在 console 運行測試。 按 Ctrl+Shift+P在 Mac 上是 Cmd+Shift+P並輸入open shell,打開 Replit 控制檯。
`tests/1_unit-tests.js` 中寫下以下測試:

View File

@@ -11,7 +11,7 @@ dashedName: issue-tracker
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似: <https://issue-tracker.freecodecamp.rocks/>。 可以採用下面的任意一種方式完成這個挑戰:
- 克隆 [GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-project-issuetracker/) 並在本地完成你的項目。
- 使用 [repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-issuetracker) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker)來完成你的項目。
- 使用一個你喜歡的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
完成本項目後,請將一個正常運行的 demo項目演示託管在可以公開訪問的平臺。 然後在 `Solution Link` 框中提交你的項目 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
@@ -22,7 +22,7 @@ dashedName: issue-tracker
-`tests/2_functional-tests.js` 中創建所有的功能測試
- 複製 `sample.env` 文件到 `.env` 並按需設置變量
- 要運行測試,在 `.env` 文件中取消註釋 `NODE_ENV=test`
- 使用 `npm run test` 命令,在 console 運行測試。 按 Ctrl+Shift+P (在 Mac 上是 Cmd+Shift+P) 並輸入"open shell",打開 Repl.it 控制檯。
- 使用 `npm run test` 命令,在 console 運行測試。 按 Ctrl+Shift+P在 Mac 上是 Cmd+Shift+P並輸入open shell,打開 Replit 控制檯。
`tests/2_functional-tests.js` 中編寫下以下測試:

View File

@@ -11,7 +11,7 @@ dashedName: metric-imperial-converter
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://metric-imperial-converter.freecodecamp.rocks/>。 可以採用下面的任意一種方式完成這個挑戰:
- 克隆 [GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/) 並在本地完成你的項目。
- 使用 [repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-metricimpconverter) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-metricimpconverter)來完成你的項目。
- 使用一個你喜歡的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
完成本項目後,請將一個正常運行的 demo項目演示託管在可以公開訪問的平臺。 然後在 `Solution Link` 框中提交你的項目 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
@@ -22,7 +22,7 @@ dashedName: metric-imperial-converter
-`/routes/api.js` 中完成必要的路由
- 複製 `sample.env` 文件到 `.env` 並按需設置變量
-`.env` 文件中取消註釋 `NODE_ENV=test` 來運行測試
- 使用 `npm run test` 命令在 console 中運行測試。 按 Ctrl+Shift+P (在 Mac 上是 Cmd+Shift+P) 並輸入"open shell",打開 Repl.it 控制檯。
- 使用 `npm run test` 命令在 console 中運行測試。 按 Ctrl+Shift+P在 Mac 上是 Cmd+Shift+P並輸入open shell,打開 Replit 控制檯。
`tests/1_unit-tests.js` 中寫下以下測試:

View File

@@ -11,7 +11,7 @@ dashedName: personal-library
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://personal-library.freecodecamp.rocks/>。 可以採用下面的任意一種方式完成這個挑戰:
- 克隆 [這個 GitHub 倉庫](https://github.com/freeCodeCamp/boilerplate-project-library) 並在本地完成項目。
- 使用 [repl.it 上的初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-library) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-library)來完成你的項目。
- 使用一個你喜歡的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
完成本項目後,請將一個正常運行的 demo項目演示託管在可以公開訪問的平臺。 然後在 `Solution Link` 框中提交你的項目 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。

View File

@@ -10,7 +10,7 @@ dashedName: sudoku-solver
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://sudoku-solver.freecodecamp.rocks/>。 可以採用下面的任意一種方式完成這個挑戰:
- 克隆 [GitHub 倉庫](https://github.com/freecodecamp/boilerplate-project-sudoku-solver) 並在本地完成你的項目。
- 使用 [repl.it 初始化項目](https://repl.it/github/freeCodeCamp/boilerplate-project-sudoku-solver) 來完成項目。
- 使用[我們的 Replit 初始化項目](https://replit.com/github/freeCodeCamp/boilerplate-project-sudoku-solver)來完成你的項目。
- 使用一個你喜歡的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
完成本項目後,請將一個正常運行的 demo項目演示託管在可以公開訪問的平臺。 然後在 `Solution Link` 框中提交你的項目 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
@@ -24,7 +24,7 @@ dashedName: sudoku-solver
- 所有路由邏輯都可以進入 `/routes/api.js`
- 閱讀 `/controllers` 中的 `puzzle-strings.js` 文件來了解一些應用程序應該解決的示例謎題
-`.env` 文件中將 `NODE_ENV` 設置爲 `test` (沒有引號),運行這個頁面的挑戰測試。
- 使用 `npm run test` 命令在 console 中運行測試。 按 Ctrl+Shift+P (在 Mac 上是 Cmd+Shift+P) 並輸入"open shell",打開 Repl.it 控制檯。
- 使用 `npm run test` 命令在 console 中運行測試。 按 Ctrl+Shift+P在 Mac 上是 Cmd+Shift+P並輸入open shell,打開 Replit 控制檯。
`tests/1_unit-tests.js` 中寫下以下測試: