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

This commit is contained in:
camperbot
2021-07-16 11:03:16 +05:30
committed by GitHub
parent 1f5f07cad3
commit 3b32da0191
429 changed files with 7502 additions and 4006 deletions

View File

@@ -1,6 +1,6 @@
---
id: 5895f70cf9fc0f352b528e67
title: Implement the Serialization of a Passport User
title: Implementare la serializzazione di un utente Passport
challengeType: 2
forumTopicId: 301556
dashedName: implement-the-serialization-of-a-passport-user
@@ -8,11 +8,11 @@ dashedName: implement-the-serialization-of-a-passport-user
# --description--
Right now, we're not loading an actual user object since we haven't set up our database. This can be done many different ways, but for our project we will connect to the database once when we start the server and keep a persistent connection for the full life-cycle of the app. To do this, add your database's connection string (for example: `mongodb+srv://:@cluster0-jvwxi.mongodb.net/?retryWrites=true&w=majority`) to the environment variable `MONGO_URI`. This is used in the `connection.js` file.
Per ora non stiamo caricando un oggetto utente reale visto che non abbiamo creato il database. Questo può essere fatto in molti modi diversi, ma per il nostro progetto ci connetteremo al database una volta che avremo avviato il server e ottenuto una connessione persistente per tutto il ciclo di vita dell'app. Per fare questo, aggiungi la stringa di connessione del database (per esempio: `mongodb+srv://:@cluster0-jvwxi.mongodb.net/?retryWrites=true&w=majority`) alla variabile ambientale `MONGO_URI`. Questo è usato nel file `connection.js`.
*You can set up a free database on [MongoDB Atlas](https://www.mongodb.com/cloud/atlas).*
*Puoi creare un database gratuito su [MongoDB Atlas](https://www.mongodb.com/cloud/atlas).*
Now we want to connect to our database then start listening for requests. The purpose of this is to not allow requests before our database is connected or if there is a database error. To accomplish this, you will want to encompass your serialization and your app routes in the following code:
Ora vogliamo connetterci al nostro database e metterci in ascolto delle richieste. Lo scopo è di non permettere richieste prima che il database sia connesso o nel caso ci sia un errore del database. Per farlo, dovrai includere la tua serializzazione e le rotte della tua app nel seguente codice:
```js
myDB(async client => {
@@ -38,13 +38,13 @@ myDB(async client => {
// app.listen out here...
```
Be sure to uncomment the `myDataBase` code in `deserializeUser`, and edit your `done(null, null)` to include the `doc`.
Assicurati di decommentare il codice di `myDataBase` in `deserializeUser`, e modifica il tuo `done(null, null)` per includere il `doc`.
Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point [here](https://gist.github.com/camperbot/175f2f585a2d8034044c7e8857d5add7).
Invia la tua pagina quando pensi di averlo fatto correttamente. Se dovessi incontrare degli errori, puoi controllare il progetto completato fino a questo punto [qui](https://gist.github.com/camperbot/175f2f585a2d8034044c7e8857d5add7).
# --hints--
Database connection should be present.
La connessione al database dovrebbe essere presente.
```js
(getUserInput) =>
@@ -62,7 +62,7 @@ Database connection should be present.
);
```
Deserialization should now be correctly using the DB and `done(null, null)` should be called with the `doc`.
La deserializzazione dovrebbe ora usare correttamente il DB e `done(null, null)` dovrebbe essere invocato con il `doc`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 589a8eb3f9fc0f352b528e72
title: Implementation of Social Authentication III
title: Implementazione dell'autenticazione con i social III
challengeType: 2
forumTopicId: 301558
dashedName: implementation-of-social-authentication-iii
@@ -8,7 +8,7 @@ dashedName: implementation-of-social-authentication-iii
# --description--
The final part of the strategy is handling the profile returned from GitHub. We need to load the user's database object if it exists, or create one if it doesn't, and populate the fields from the profile, then return the user's object. GitHub supplies us a unique *id* within each profile which we can use to search with to serialize the user with (already implemented). Below is an example implementation you can use in your project--it goes within the function that is the second argument for the new strategy, right below where `console.log(profile);` currently is:
La parte finale della strategia è gestire il profilo restituito da GitHub. Dobbiamo caricare l'oggetto del database relativo all'uutente se esiste, o crearne uno se non esiste, e popolare i campi dal profilo, quindi restituire l'oggetto dell'utente. GitHub ci fornisce un *id* unico per ogni profilo che possiamo usare per cercare e serializzare l'utente (già implementato). Di seguito è riportato un esempio di implementazione che puoi usare nel tuo progetto: va all'interno della funzione che è il secondo argomento per la nuova strategia, proprio sotto all'attuale posizione di `console.log(profile);`:
```js
myDataBase.findOneAndUpdate(
@@ -38,15 +38,15 @@ myDataBase.findOneAndUpdate(
);
```
`findOneAndUpdate` allows you to search for an object and update it. If the object doesn't exist, it will be inserted and made available to the callback function. In this example, we always set `last_login`, increment the `login_count` by `1`, and only populate the majority of the fields when a new object (new user) is inserted. Notice the use of default values. Sometimes a profile returned won't have all the information filled out or the user will keep it private. In this case, you handle it to prevent an error.
`findOneAndUpdate` ti permette di cercare un oggetto e aggiornarlo. Se l'oggetto non esiste, verrà inserito e reso disponibile alla funzione di callback. In questo esempio, abbiamo sempre impostato `last_login`, incrementato il `login_count` di `1`, e popolato la maggior parte dei campi solo quando viene inserito un nuovo oggetto (nuovo utente). Nota l'uso dei valori predefiniti. A volte un profilo restituito non avrà tutte le informazioni compilate o l'utente lo manterrà privato. Dovrai gestire questo caso per evitare un errore.
You should be able to login to your app now--try it!
Ora dovresti essere in grado di accedere alla tua app, provala!
Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point [here](https://gist.github.com/camperbot/183e968f0e01d81dde015d45ba9d2745).
Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi controllare il progetto completato fino a questo punto [qui](https://gist.github.com/camperbot/183e968f0e01d81dde015d45ba9d2745).
# --hints--
GitHub strategy setup should be complete.
La configurazione della strategia GitHub dovrebbe essere completa.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 5895f70cf9fc0f352b528e66
title: Serialization of a User Object
title: Serializzazione di un oggetto utente
challengeType: 2
forumTopicId: 301563
dashedName: serialization-of-a-user-object
@@ -8,11 +8,11 @@ dashedName: serialization-of-a-user-object
# --description--
Serialization and deserialization are important concepts in regards to authentication. To serialize an object means to convert its contents into a small *key* that can then be deserialized into the original object. This is what allows us to know who has communicated with the server without having to send the authentication data, like the username and password, at each request for a new page.
La serializzazione e la deserializzazione sono concetti importanti per quanto riguarda l'autenticazione. Serializzare un oggetto significa convertire il suo contenuto in una piccola *chiave* (key) che può essere deserializzata nell'oggetto originale. Questo ci permette di sapere chi ha comunicato con il server senza dover inviare i dati di autenticazione, come il nome utente e la password, ad ogni richiesta di una nuova pagina.
To set this up properly, we need to have a serialize function and a deserialize function. In Passport, we create these with `passport.serializeUser( OURFUNCTION )` and `passport.deserializeUser( OURFUNCTION )`
Per configurarlo correttamente, dobbiamo avere una funzione di serializzazione e una funzione di deserializzazione. In Passport, li creiamo con `passport.serializeUser( OURFUNCTION )` e `passport.deserializeUser( OURFUNCTION )`
The `serializeUser` is called with 2 arguments, the full user object and a callback used by passport. A unique key to identify that user should be returned in the callback, the easiest one to use being the user's `_id` in the object. It should be unique as it is generated by MongoDB. Similarly, `deserializeUser` is called with that key and a callback function for passport as well, but, this time, we have to take that key and return the full user object to the callback. To make a query search for a Mongo `_id`, you will have to create `const ObjectID = require('mongodb').ObjectID;`, and then to use it you call `new ObjectID(THE_ID)`. Be sure to add `mongodb@~3.6.0` as a dependency. You can see this in the examples below:
`serializeUser` è chiamato con 2 argomenti, l'oggetto utente completo e una callback utilizzata da passport. Una chiave univoca per identificare quell'utente deve essere restituita nella callback, quello più semplice da usare è l'`_id` dell'utente nell'oggetto. Esso dovrebbe essere unico dato che è stato generato da MongoDB. Allo stesso modo, anche `deserializeUser` viene chiamato con quella chiave e una funzione callback per passport, ma questa volta dobbiamo prendere quella chiave e restituire l'intero oggetto utente alla callback. Per creare una query di ricerca per un `_id` Mongo, dovrai creare `const ObjectID = require('mongodb').ObjectID;`, e poi per usarlo invocare `new ObjectID(THE_ID)`. Assicurati di aggiungere `mongodb@~3.6.0` come dipendenza. Puoi vederlo negli esempi qui sotto:
```js
passport.serializeUser((user, done) => {
@@ -26,13 +26,13 @@ passport.deserializeUser((id, done) => {
});
```
NOTE: This `deserializeUser` will throw an error until we set up the DB in the next step, so for now comment out the whole block and just call `done(null, null)` in the function `deserializeUser`.
NOTA: Questo `deserializeUser` genererà un errore fino a quando non imposteremo il DB nel passo successivo, quindi per ora commenta l'intero blocco e chiama `done(null, null)` nella funzione `deserializeUser`.
Submit your page when you think you've got it right. If you're running into errors, you can check out the project completed up to this point [here](https://gist.github.com/camperbot/7068a0d09e61ec7424572b366751f048).
Invia la tua pagina quando pensi di averlo fatto correttamente. Se incontri degli errori, puoi controllare il progetto completato fino a questo punto [qui](https://gist.github.com/camperbot/7068a0d09e61ec7424572b366751f048).
# --hints--
You should serialize user function correctly.
Dovresti serializzare correttamente la funzione user.
```js
(getUserInput) =>
@@ -55,7 +55,7 @@ You should serialize user function correctly.
);
```
You should deserialize user function correctly.
Dovresti deserializzare correttamente la funzione user.
```js
(getUserInput) =>
@@ -78,7 +78,7 @@ You should deserialize user function correctly.
);
```
MongoDB should be a dependency.
MongoDB dovrebbe essere una dipendenza.
```js
(getUserInput) =>
@@ -97,7 +97,7 @@ MongoDB should be a dependency.
);
```
Mongodb should be properly required including the ObjectId.
Mongodb dovrebbe essere richiesto correttamente, includendo l'ObjectId.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824c367417b2b2512c4c
title: Assert Deep Equality with .deepEqual and .notDeepEqual
title: Asserire l'uguaglianza profonda con .deepEqual e .notDeepEqual
challengeType: 2
forumTopicId: 301587
dashedName: assert-deep-equality-with--deepequal-and--notdeepequal
@@ -8,17 +8,17 @@ dashedName: assert-deep-equality-with--deepequal-and--notdeepequal
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`deepEqual()` asserts that two objects are deep equal.
`deepEqual()` afferma che due oggetti sono uguali in maniera profonda.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#7` in the `Equality` suite, change each `assert` to either `assert.deepEqual` or `assert.notDeepEqual` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#7`, nella suite `Equality`, cambia ogni asserzione `assert` in `assert.deepEqual` o `assert.notDeepEqual` per far superare il test (dovrebbe risultare `true`). Non alterare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -32,7 +32,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `deepEqual` vs. `notDeepEqual`.
Dovresti scegliere il metodo corretto per la prima asserzione - `deepEqual` oppure `notDeepEqual`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `deepEqual` vs. `
);
```
You should choose the correct method for the second assertion - `deepEqual` vs. `notDeepEqual`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `deepEqual` oppure `notDeepEqual`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824c367417b2b2512c4d
title: Compare the Properties of Two Elements
title: Confrontare le proprietà di due elementi
challengeType: 2
forumTopicId: 301588
dashedName: compare-the-properties-of-two-elements
@@ -8,15 +8,15 @@ dashedName: compare-the-properties-of-two-elements
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#8` in the `Comparisons` suite, change each `assert` to either `assert.isAbove` or `assert.isAtMost` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#8`, nella suite `Comparisons`, cambia ogni asserzione `assert` in `assert.isAbove` o `assert.isAtMost` per far superare il test (dovrebbe risultare `true`). Non alterare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -30,7 +30,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `isAbove` vs. `isAtMost`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isAbove` oppure `isAtMost`.
```js
(getUserInput) =>
@@ -48,7 +48,7 @@ You should choose the correct method for the first assertion - `isAbove` vs. `is
);
```
You should choose the correct method for the second assertion - `isAbove` vs. `isAtMost`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isAbove` oppure `isAtMost`.
```js
(getUserInput) =>
@@ -62,7 +62,7 @@ You should choose the correct method for the second assertion - `isAbove` vs. `i
);
```
You should choose the correct method for the third assertion - `isAbove` vs. `isAtMost`.
Dovresti scegliere il metodo corretto per la terza asserzione - `isAbove` oppure `isAtMost`.
```js
(getUserInput) =>
@@ -80,7 +80,7 @@ You should choose the correct method for the third assertion - `isAbove` vs. `is
);
```
You should choose the correct method for the fourth assertion - `isAbove` vs. `isAtMost`.
Dovresti scegliere il metodo corretto per la quarta asserzione - `isAbove` oppure `isAtMost`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824f367417b2b2512c5a
title: Run Functional Tests on an API Response using Chai-HTTP III - PUT method
title: Eseguire test funzionali su una risposta API utilizzando il metodo Chai-HTTP III - PUT
challengeType: 2
forumTopicId: 301590
dashedName: run-functional-tests-on-an-api-response-using-chai-http-iii---put-method
@@ -8,9 +8,9 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iii---put-me
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
In the next example we'll see how to send data in a request payload (body). We are going to test a PUT request. The `'/travellers'` endpoint accepts a JSON object taking the structure:
Nel prossimo esempio vedremo come inviare i dati in nel corpo di un payload di richiesta. Stiamo per testare una richiesta PUT. L'endpoint `'/travellers'` accetta un oggetto JSON che prende la struttura:
```json
{
@@ -18,7 +18,7 @@ In the next example we'll see how to send data in a request payload (body). We a
}
```
The route responds with :
La rotta risponde con:
```json
{
@@ -26,13 +26,13 @@ The route responds with :
}
```
See the server code for more details.
Vedi il codice del server per maggiori dettagli.
# --instructions--
Within `tests/2_functional-tests.js`, alter the `'send {surname: "Colombo"}'` test (`// #3`):
All'interno di `tests/2_functional-tests.js`, modifica il test `'send {surname: "Colombo"}'` (`// #3`):
Send the following JSON response as a payload:
Invia la seguente risposta JSON come payload:
```json
{
@@ -40,18 +40,18 @@ Send the following JSON response as a payload:
}
```
Check for the following, within the `request.end` callback:
Controlla quanto segue, all'interno della callback `request.end`:
1. `status`
2. `type`
3. `body.name`
4. `body.surname`
Follow the assertion order above - we rely on it. Be sure to remove `assert.fail()`, once complete.
Segui l'ordine di asserzione indicato sopra - facciamo affidamento su di esso. Assicurati di rimuovere `assert.fail()`, una volta finito.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -65,7 +65,7 @@ All tests should pass.
);
```
You should test for 'res.status' to be 200.
Dovresti verificare che 'res.status' sia 200.
```js
(getUserInput) =>
@@ -81,7 +81,7 @@ You should test for 'res.status' to be 200.
);
```
You should test for 'res.type' to be 'application/json'.
Dovresti verificare che 'res.type' sia 'application/json'.
```js
(getUserInput) =>
@@ -97,7 +97,7 @@ You should test for 'res.type' to be 'application/json'.
);
```
You should test for 'res.body.name' to be 'Cristoforo'.
Dovresti verificare che 'res.body.name' sia 'Cristoforo''.
```js
(getUserInput) =>
@@ -113,7 +113,7 @@ You should test for 'res.body.name' to be 'Cristoforo'.
);
```
You should test for 'res.body.surname' to be 'Colombo'.
Dovresti verificare che 'res.body.surname' sia 'Colombo''.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 5f8884f4c46685731aabfc41
title: Run Functional Tests Using a Headless Browser II
title: Eseguire test funzionali usando un headless browser II
challengeType: 2
forumTopicId: 301594
dashedName: run-functional-tests-using-a-headless-browser-ii
@@ -8,27 +8,27 @@ dashedName: run-functional-tests-using-a-headless-browser-ii
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
# --instructions--
Within `tests/2_functional-tests.js`, in the `'submit "surname" : "Vespucci" - write your e2e test...'` test (`// #6`), automate filling-in and submitting the form from scratch:
All'interno di `tests/2_functional-tests.js`, nel test `'submit "surname" : "Vespucci" - write your e2e test...'` (`// #6`), automatizza la compilazione e invia il modulo:
1. Fill in the form with the `surname` of `Vespucci`
2. Submit it pressing `'submit'` button
1. Compila il modulo con il `surname` di `Vespucci`
2. Invia premendo il pulsante `'submit'`
Within the callback:
All'interno della callback:
1. assert that status is `200`
2. assert that the text inside the element `span#name` is `'Amerigo'`
3. assert that the text inside the element `span#surname` is `'Vespucci'`
4. assert that the element(s) `span#dates` exist and their count is `1`
1. asserisci che lo stato è `200`
2. asserisci che il testo all'interno dell'elemento `span#name` è `'Amerigo'`
3. asserisci che il testo all'interno dell'elemento `span#surname` è `'Vespucci'`
4. asserisci che gli elementi `span#dates` esistono e il loro conteggio è `1`
Do not forget to to remove the `assert.fail()` call.
Non dimenticare di rimuovere la chiamata `assert.fail()`.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -42,7 +42,7 @@ All tests should pass.
);
```
You should assert that the headless browser request succeeded.
Dovresti asserire che la richiesta dell'headless browser sia riuscita.
```js
(getUserInput) =>
@@ -56,7 +56,7 @@ You should assert that the headless browser request succeeded.
);
```
You should assert that the text inside the element 'span#name' is 'Amerigo'.
Dovresti asserire che il testo all'interno dell'elemento 'span#name' sia 'Amerigo'.
```js
(getUserInput) =>
@@ -72,7 +72,7 @@ You should assert that the text inside the element 'span#name' is 'Amerigo'.
);
```
You should assert that the text inside the element 'span#surname' is 'Vespucci'.
Dovresti asserire che il testo all'interno dell'elemento 'span#surname' sia 'Vespucci'.
```js
(getUserInput) =>
@@ -88,7 +88,7 @@ You should assert that the text inside the element 'span#surname' is 'Vespucci'.
);
```
You should assert that the element 'span#dates' exist and its count is 1.
Dovresti asserire che l'elemento 'span#dates' esista e il suo conteggio sia 1.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824d367417b2b2512c50
title: Test if a Value is an Array
title: Verificare se un valore è un array
challengeType: 2
forumTopicId: 301600
dashedName: test-if-a-value-is-an-array
@@ -8,15 +8,15 @@ dashedName: test-if-a-value-is-an-array
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#11` in the `Arrays` suite, change each `assert` to either `assert.isArray` or `assert.isNotArray` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#11`, nella suite `Arrays`, cambia ogni asserzione `assert` in `assert.isArray` o `assert.isNotArray` per far superare il test (dovrebbe risultare `true`). Non alterare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -30,7 +30,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `isArray` vs. `isNotArray`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isArray` oppure `isNotArray`.
```js
(getUserInput) =>
@@ -48,7 +48,7 @@ You should choose the correct method for the first assertion - `isArray` vs. `is
);
```
You should choose the correct method for the second assertion - `isArray` vs. `isNotArray`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isArray` oppure `isNotArray`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824e367417b2b2512c55
title: Test if an Object has a Property
title: Verificare se un oggetto ha una proprietà
challengeType: 2
forumTopicId: 301604
dashedName: test-if-an-object-has-a-property
@@ -8,17 +8,17 @@ dashedName: test-if-an-object-has-a-property
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`property` asserts that the actual object has a given property.
`property` asserisce che l'oggetto effettivo ha una data proprietà.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#16` in the `Objects` suite, change each `assert` to either `assert.property` or `assert.notProperty` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#16`, nella suite `Objects`, cambia ogni asserzione `assert` in `assert.property` o `assert.notProperty` per far passare il test (dovrebbe risultare `true`). Non alterare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -32,7 +32,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `property` vs. `notProperty`.
Dovresti scegliere il metodo corretto per la prima asserzione - `property` oppure `notProperty`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `property` vs. `n
);
```
You should choose the correct method for the second assertion - `property` vs. `notProperty`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `property` oppure `notProperty`.
```js
(getUserInput) =>
@@ -68,7 +68,7 @@ You should choose the correct method for the second assertion - `property` vs. `
);
```
You should choose the correct method for the third assertion - `property` vs. `notProperty`.
Dovresti scegliere il metodo corretto per la terza asserzione - `property` oppure `notProperty`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824e367417b2b2512c57
title: Test if an Object is an Instance of a Constructor
title: Verificare se un oggetto è l'istanza di un costruttore
challengeType: 2
forumTopicId: 301605
dashedName: test-if-an-object-is-an-instance-of-a-constructor
@@ -8,17 +8,17 @@ dashedName: test-if-an-object-is-an-instance-of-a-constructor
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`#instanceOf` asserts that an object is an instance of a constructor.
`#instanceOf` afferma che un oggetto è un'istanza di un costruttore.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#18` in the `Objects` suite, change each `assert` to either `assert.instanceOf` or `assert.notInstanceOf` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#18`, nella suite `Objects`, cambia ogni asserzione `assert` in `assert.instanceOf` o `assert.notInstanceOf` per far superare il test (dovrebbe risultare `true`). Non alterare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -32,7 +32,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `instanceOf` vs. `notInstanceOf`.
Dovresti scegliere il metodo corretto per la prima asserzione - `instanceOf` oppure `notInstanceOf`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `instanceOf` vs.
);
```
You should choose the correct method for the second assertion - `instanceOf` vs. `notInstanceOf`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `instanceOf` oppure `notInstanceOf`.
```js
(getUserInput) =>
@@ -68,7 +68,7 @@ You should choose the correct method for the second assertion - `instanceOf` vs.
);
```
You should choose the correct method for the third assertion - `instanceOf` vs. `notInstanceOf`.
Dovresti scegliere il metodo corretto per la terza asserzione - `instanceOf` oppure `notInstanceOf`.
```js
(getUserInput) =>
@@ -86,7 +86,7 @@ You should choose the correct method for the third assertion - `instanceOf` vs.
);
```
You should choose the correct method for the fourth assertion - `instanceOf` vs. `notInstanceOf`.
Dovresti scegliere il metodo corretto per la quarta asserzione - `instanceOf` oppure `notInstanceOf`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824b367417b2b2512c48
title: Use Assert.isOK and Assert.isNotOK
title: Usa Assert.isOK e Assert.isNotOK
challengeType: 2
forumTopicId: 301607
dashedName: use-assert-isok-and-assert-isnotok
@@ -8,19 +8,19 @@ dashedName: use-assert-isok-and-assert-isnotok
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`isOk()` will test for a truthy value, and `isNotOk()` will test for a falsy value.
`isOk()` verificherà se un valore è veritiero e `isNotOk()` verificherà se un valore è falso.
To learn more about truthy and falsy values, try our [Falsy Bouncer](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer) challenge.
Per saperne di più sui valori veritieri e falsi, prova la nostra sfida [Falsy Bouncer](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/falsy-bouncer).
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#3` in the `Basic Assertions` suite, change each `assert` to either `assert.isOk()` or `assert.isNotOk()` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#3`, nella suite `Basic Assertions`, cambia ogni asserzione `assert` in `assert.isOk()` o `assert.isNotOk()` per far superare il test (dovrebbe risultare `true`). Non alterare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -34,7 +34,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `isOk` vs. `isNotOk`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isOk` oppure `isNotOk`.
```js
(getUserInput) =>
@@ -48,7 +48,7 @@ You should choose the correct method for the first assertion - `isOk` vs. `isNot
);
```
You should choose the correct method for the second assertion - `isOk` vs. `isNotOk`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isOk` oppure `isNotOk`.
```js
(getUserInput) =>
@@ -62,7 +62,7 @@ You should choose the correct method for the second assertion - `isOk` vs. `isNo
);
```
You should choose the correct method for the third assertion - `isOk` vs. `isNotOk`.
Dovresti scegliere il metodo corretto per la terza asserzione - `isOk` oppure `isNotOk`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824d367417b2b2512c54
title: Use Regular Expressions to Test a String
title: Usare espressioni regolari per testare una stringa
challengeType: 2
forumTopicId: 301608
dashedName: use-regular-expressions-to-test-a-string
@@ -8,17 +8,17 @@ dashedName: use-regular-expressions-to-test-a-string
# --description--
As a reminder, this project is being built upon the following starter project on [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), or cloned from [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Come promemoria, questo progetto viene costruito a partire dal seguente progetto iniziale su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`match()` asserts that the actual value matches the second argument regular expression.
`match()` afferma che il valore effettivo corrisponde al secondo argomento espressione regolare.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#15` in the `Strings` suite, change each `assert` to either `assert.match` or `assert.notMatch` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#15`, nella suite `Strings`, cambia ogni asserzione `assert` in `assert.match` o `assert.notMatch` per far passare il test (dovrebbe risultare `true`). Non alterare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -32,7 +32,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `match` vs. `notMatch`.
Dovresti scegliere il metodo corretto per la prima asserzione - `match` oppure `notMatch`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `match` vs. `notM
);
```
You should choose the correct method for the second assertion - `match` vs. `notMatch`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `match` oppure `notMatch`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 5e601c0d5ac9d0ecd8b94afe
title: American British Translator
title: Traduttore Americano Britannico
challengeType: 4
forumTopicId: 462358
dashedName: american-british-translator
@@ -8,62 +8,62 @@ dashedName: american-british-translator
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://american-british-translator.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods:
Costruisci un'app JavaScript full-stack che sia funzionalmente simile a questa: <https://american-british-translator.freecodecamp.rocks/>. Lavorare su questo progetto ti porterà a scrivere il tuo codice utilizzando uno dei seguenti metodi:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator) to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clona [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/) e completa il tuo progetto localmente.
- Usa [il nostro progetto di avvio Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator) per completare il tuo progetto.
- Usa un costruttore di siti di tua scelta per completare il progetto. Assicurati di incorporare tutti i file del nostro repository GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
Quando hai finito, assicurati che una demo funzionante del tuo progetto sia ospitata in qualche percorso pubblico. Quindi invia l'URL nel campo `Solution Link`. Facoltativamente, invia anche un link al codice sorgente del tuo progetto nel campo `GitHub Link`.
# --instructions--
- All logic can go into `/components/translator.js`
- Complete the `/api/translate` route in `/routes/api.js`
- Create all of the unit/functional tests in `tests/1_unit-tests.js` and `tests/2_functional-tests.js`
- See the JavaScript files in `/components` for the different spelling and terms your application should translate
- To run the tests on Replit, set `NODE_ENV` to `test` without quotes in the `.env` file
- To run the tests in the console, use the command `npm run test`. To open the Replit console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell"
- Tutta la logica può stare in `/components/translator.js`
- Completa la rotta `/api/translate` in `/routes/api.js`
- Crea tutti i test delle unità/funzionali in `tests/1_unit-tests.js` e `tests/2_functional-tests.js`
- Vedi i file JavaScript in `/components` per la diversa ortografia e i termini che la tua applicazione dovrebbe tradurre
- Per eseguire i test su Replit, imposta `NODE_ENV` a `test` senza virgolette nel file `.env`
- Per eseguire i test nella console, utilizza il comando `npm run test`. Per aprire la console di Replit, premi Ctrl+Maiusc+P (Cmd se su un Mac) e digita "open shell"
Write the following tests in `tests/1_unit-tests.js`:
Scrivi i seguenti test in `tests/1_unit-tests.js`:
- Translate `Mangoes are my favorite fruit.` to British English
- Translate `I ate yogurt for breakfast.` to British English
- Translate `We had a party at my friend's condo.` to British English
- Translate `Can you toss this in the trashcan for me?` to British English
- Translate `The parking lot was full.` to British English
- Translate `Like a high tech Rube Goldberg machine.` to British English
- Translate `To play hooky means to skip class or work.` to British English
- Translate `No Mr. Bond, I expect you to die.` to British English
- Translate `Dr. Grosh will see you now.` to British English
- Translate `Lunch is at 12:15 today.` to British English
- Translate `We watched the footie match for a while.` to American English
- Translate `Paracetamol takes up to an hour to work.` to American English
- Translate `First, caramelise the onions.` to American English
- Translate `I spent the bank holiday at the funfair.` to American English
- Translate `I had a bicky then went to the chippy.` to American English
- Translate `I've just got bits and bobs in my bum bag.` to American English
- Translate `The car boot sale at Boxted Airfield was called off.` to American English
- Translate `Have you met Mrs Kalyani?` to American English
- Translate `Prof Joyner of King's College, London.` to American English
- Translate `Tea time is usually around 4 or 4.30.` to American English
- Highlight translation in `Mangoes are my favorite fruit.`
- Highlight translation in `I ate yogurt for breakfast.`
- Highlight translation in `We watched the footie match for a while.`
- Highlight translation in `Paracetamol takes up to an hour to work.`
- Traduci `Mangoes are my favorite fruit.` in inglese britannico
- Traduci `I ate yogurt for breakfast.` in inglese britannico
- Traduci `We had a party at my friend's condo.` in inglese britannico
- Traduci `Can you toss this in the trashcan for me?` in inglese britannico
- Traduci `The parking lot was full.` in inglese britannico
- Traduci `Like a high tech Rube Goldberg machine.` in inglese britannico
- Traduci `To play hooky means to skip class or work.` in inglese britannico
- Traduci `No Mr. Bond, I expect you to die.` in inglese britannico
- Traduci `Dr. Grosh will see you now.` in inglese britannico
- Traduci `Lunch is at 12:15 today.` in inglese britannico
- Traduci `We watched the footie match for a while.` in inglese americano
- Traduci `Paracetamol takes up to an hour to work.` in inglese americano
- Traduci `First, caramelise the onions.` in inglese americano
- Traduci `I spent the bank holiday at the funfair.` in inglese americano
- Traduci `I had a bicky then went to the chippy.` in inglese americano
- Traduci `I've just got bits and bobs in my bum bag.` in inglese americano
- Traduci `The car boot sale at Boxted Airfield was called off.` in inglese americano
- Traduci `Have you met Mrs Kalyani?` in inglese americano
- Traduci `Prof Joyner of King's College, London.` in inglese americano
- Traduci `Tea time is usually around 4 or 4.30.` in inglese americano
- Evidenzia la traduzione in `Mangoes are my favorite fruit.`
- Evidenzia la traduzione in `I ate yogurt for breakfast.`
- Evidenzia la traduzione in `We watched the footie match for a while.`
- Evidenzia la traduzione in `Paracetamol takes up to an hour to work.`
Write the following tests in `tests/2_functional-tests.js`:
Scrivi i seguenti test in `tests/2_functional-tests.js`:
- Translation with text and locale fields: POST request to `/api/translate`
- Translation with text and invalid locale field: POST request to `/api/translate`
- Translation with missing text field: POST request to `/api/translate`
- Translation with missing locale field: POST request to `/api/translate`
- Translation with empty text: POST request to `/api/translate`
- Translation with text that needs no translation: POST request to `/api/translate`
- Traduzione con i campi testo e localizzazione: richiesta POST a `/api/translate`
- Traduzione con i campi testo e localizzazione non validi: richiesta POST a `/api/translate`
- Traduzione con il campo testo mancante: richiesta POST a `/api/translate`
- Traduzione con il campo localizzazione mancante: richiesta POST a `/api/translate`
- Traduzione con il testo vuoto: richiesta POST a `/api/translate`
- Traduzione con testo che non ha bisogno di traduzione: richiesta POST a `/api/translate`
# --hints--
I can provide my own project, not the example URL.
È necessario fornire il proprio progetto, non l'URL di esempio.
```js
(getUserInput) => {
@@ -75,7 +75,7 @@ I can provide my own project, not the example URL.
};
```
You can `POST` to `/api/translate` with a body containing `text` with the text to translate and `locale` with either `american-to-british` or `british-to-american`. The returned object should contain the submitted `text` and `translation` with the translated text.
Puoi fare una richiesta `POST` a `/api/translate` con un corpo contenente `text` con il testo da tradurre e `locale` con `american-to-british` (da americano a britannico) o `british-to-american` (da britannico ad americano). L'oggetto restituito dovrebbe contenere il testo inviato (`text`) e la traduzione (`translation`).
```js
async (getUserInput) => {
@@ -103,7 +103,7 @@ async (getUserInput) => {
};
```
The `/api/translate` route should handle the way time is written in American and British English. For example, ten thirty is written as "10.30" in British English and "10:30" in American English. The `span` element should wrap the entire time string, i.e. `<span class="highlight">10:30</span>`.
Il percorso `/api/translate` dovrebbe gestire la differenza di come l'ora è scritta in inglese americano o britannico. Per esempio l'orario dieci e trenta è scritto "10.30" in inglese britannico e "10:30" in inglese americano. L'elemento `span` dovrebbe racchiudere tutta la stringa del tempo, per esempio `<span class="highlight">10:30</span>`.
```js
async (getUserInput) => {
@@ -130,7 +130,7 @@ async (getUserInput) => {
};
```
The `/api/translate` route should also handle the way titles/honorifics are abbreviated in American and British English. For example, Doctor Wright is abbreviated as "Dr Wright" in British English and "Dr. Wright" in American English. See `/components/american-to-british-titles.js` for the different titles your application should handle.
Il percorso `/api/translate` dovrebbe gestire anche la differenza di come i titoli onorifici sono abbreviati in inglese americano o britannico. Per esempio, Doctor Wright è appreviato come "Dr Wright" in inglese britannico e "Dr. Wright" in inglese americano. Vedi `/components/american-to-british-titles.js` per sapere quali titoli la tua applicazione dpvrebbe essere in grado di gestire.
```js
async (getUserInput) => {
@@ -157,7 +157,7 @@ async (getUserInput) => {
};
```
Wrap any translated spelling or terms with `<span class="highlight">...</span>` tags so they appear in green.
Racchiudi ogni traduzione di spelling o termini con tag `<span class="highlight">...</span>` affinchè appaiano in verde.
```js
async (getUserInput) => {
@@ -185,7 +185,7 @@ async (getUserInput) => {
};
```
If one or more of the required fields is missing, return `{ error: 'Required field(s) missing' }`.
Se uno o più dei campi richiesti è mancante, restuisci `{ error: 'Required field(s) missing' }`.
```js
async (getUserInput) => {
@@ -206,7 +206,7 @@ async (getUserInput) => {
};
```
If `text` is empty, return `{ error: 'No text to translate' }`
Se `text` è vuoto restuisci `{ error: 'No text to translate' }`
```js
async (getUserInput) => {
@@ -227,7 +227,7 @@ async (getUserInput) => {
};
```
If `locale` does not match one of the two specified locales, return `{ error: 'Invalid value for locale field' }`.
Se `locale` non corrisponde a uno dei due locale specificati, restituisci `{ error: 'Invalid value for locale field' }`.
```js
async (getUserInput) => {
@@ -249,7 +249,7 @@ async (getUserInput) => {
};
```
If `text` requires no translation, return `"Everything looks good to me!"` for the `translation` value.
Se `text` non richiede traduzione, restituisci `"Everything looks good to me!"` per il valore `translation`.
```js
async (getUserInput) => {
@@ -276,7 +276,7 @@ async (getUserInput) => {
};
```
All 24 unit tests are complete and passing. See `/tests/1_unit-tests.js` for the expected behavior you should write tests for.
Tutti i 24 test unitari sono completati e superati. Vedi `/tests/1_unit-tests.js` per il comportamento previsto per il quale dovresti scrivere dei test.
```js
async (getUserInput) => {
@@ -301,7 +301,7 @@ async (getUserInput) => {
};
```
All 6 functional tests are complete and passing. See `/tests/2_functional-tests.js` for the functionality you should write tests for.
Tutti i 6 test funzionali sono completi e superati. Vedi `/tests/2_functional-tests.js` per le funzionalità per le quali dovresti scrivere dei test.
```js
async (getUserInput) => {