chore(i18n,curriculum): update translations (#42918)

This commit is contained in:
camperbot
2021-07-19 16:05:37 +05:30
committed by GitHub
parent 69a4980696
commit f3da789fa4
169 changed files with 1365 additions and 1367 deletions

View File

@@ -1,6 +1,6 @@
---
id: 5895f700f9fc0f352b528e63
title: Set up a Template Engine
title: Imposta un template engine
challengeType: 2
forumTopicId: 301564
dashedName: set-up-a-template-engine
@@ -8,31 +8,31 @@ dashedName: set-up-a-template-engine
# --description--
Working on these challenges will involve you writing your code using one of the following methods:
Lavorare su queste sfide ti porterà a scrivere il tuo codice utilizzando uno dei seguenti metodi:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-advancednode/) and complete these challenges locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-advancednode) to complete these challenges.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clonare [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-advancednode/) e completare queste sfide localmente.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-advancednode) per completare queste sfide.
- Usare un costruttore di siti di tua scelta per completare il progetto. Assicurati di incorporare tutti i file della nostra 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.
Quando hai finito, assicurati che una demo funzionante del tuo progetto sia ospitata da qualche parte di pubblico. Quindi invia l'URL nel campo `Solution Link`.
A template engine enables you to use static template files (such as those written in *Pug*) in your app. At runtime, the template engine replaces variables in a template file with actual values which can be supplied by your server. Then it transforms the template into a static HTML file that is sent to the client. This approach makes it easier to design an HTML page and allows for displaying variables on the page without needing to make an API call from the client.
Un modello di motore ti permette di utilizzare file di template statici (come quelli scritti in *Pug*) nella tua app. Al runtime, il template engine sostituisce le variabili in un file modello con valori effettivi che possono essere forniti dal tuo server. Quindi trasforma il template in un file HTML statico che viene inviato al client. Questo approccio facilita la progettazione di una pagina HTML e permette di visualizzare le variabili sulla pagina senza dover effettuare una chiamata API dal client.
Add `pug@~3.0.0` as a dependency in your `package.json` file.
Aggiungi `pug@~3.0.0` come dipendenza nel tuo file `package.json`.
Express needs to know which template engine you are using. We will use the `set` method to assign `pug` as the `view engine` property's value: `app.set('view engine', 'pug')`
Express deve sapere quale templare engine si sta utilizzando. Utilizzeremo il metodo `set` per assegnare `pug` come valore di `view engine` della proprietà: `app.set('view engine', 'pug')`
Your page will not load until you correctly render the index file in the `views/pug` directory.
La tua pagina non verrà caricata finché non esegui correttamente il rendering del file index nella directory `views/pug`.
Change the argument of the `res.render()` declaration in the `/` route to be the file path to the `views/pug` directory. The path can be a relative path (relative to views), or an absolute path, and does not require a file extension.
Modifica largomento della dichiarazione `res.render()` nella rotta `/` in modo che sia il percorso di file per la directory `views/pug`. Il percorso può essere un percorso relativo (relativo alle viste), o un percorso assoluto, e non richiede un'estensione del file.
If all went as planned, your app home page will stop showing the message "`Pug template is not defined.`" and will now display a message indicating you've successfully rendered the Pug template!
Se tutto è andato come previsto, la tua home page dell'app smetterà di mostrare il messaggio "`Pug template is not defined.`" e ora mostrerà un messaggio che indica che hai reso con successo il modello Pug!
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/3515cd676ea4dfceab4e322f59a37791).
Invia la tua pagina quando pensi che sia corretto. Se incontri degli errori, puoi controllare il progetto completato fino a questo punto [qui](https://gist.github.com/camperbot/3515cd676ea4dfceab4e322f59a37791).
# --hints--
Pug should be a dependency.
Pug dovrebbe essere una dipendenza.
```js
(getUserInput) =>
@@ -51,7 +51,7 @@ Pug should be a dependency.
);
```
View engine should be Pug.
Il motore di visualizzazione dovrebbe essere Pug.
```js
(getUserInput) =>
@@ -69,7 +69,7 @@ View engine should be Pug.
);
```
Use the correct ExpressJS method to render the index page from the response.
Utilizza il metodo ExpressJS corretto per visualizzare la pagina index dalla risposta.
```js
(getUserInput) =>
@@ -87,7 +87,7 @@ Use the correct ExpressJS method to render the index page from the response.
);
```
Pug should be working.
Pug dovrebbe funzionare.
```js
(getUserInput) =>

View File

@@ -111,7 +111,7 @@ La sessione e il segreto di sessione dovrebbero essere impostate correttamente.
(data) => {
assert.match(
data,
/secret:( |)process.env.SESSION_SECRET/gi,
/secret:( |)process\.env(\.SESSION_SECRET|\[(?<q>"|')SESSION_SECRET\k<q>\])/g,
'Your express app should have express-session set up with your secret as process.env.SESSION_SECRET'
);
},

View File

@@ -8,7 +8,7 @@ dashedName: assert-deep-equality-with--deepequal-and--notdeepequal
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`deepEqual()` afferma che due oggetti sono uguali in maniera profonda.

View File

@@ -8,7 +8,7 @@ dashedName: compare-the-properties-of-two-elements
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
# --instructions--

View File

@@ -1,6 +1,6 @@
---
id: 587d824a367417b2b2512c46
title: Learn How JavaScript Assertions Work
title: Imparare come funzionano le asserzioni Javascript
challengeType: 2
forumTopicId: 301589
dashedName: learn-how-javascript-assertions-work
@@ -8,21 +8,21 @@ dashedName: learn-how-javascript-assertions-work
# --description--
Working on these challenges will involve you writing your code using one of the following methods:
Lavorare su queste sfide ti porterà a scrivere il tuo codice utilizzando uno dei seguenti metodi:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-mochachai/) and complete these challenges locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-mochachai) to complete these challenges.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clonare [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/) e completare queste sfide localmente.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai) per completare queste sfide.
- Usare un costruttore di siti a 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.
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`.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#1` in the `Basic Assertions` suite, change each `assert` to either `assert.isNull` or `assert.isNotNull` 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 `#1`, nella suite `Basic Assertions`, cambia ogni asserzione `assert` in `assert.isNull` o `assert.isNotNull` 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) =>
@@ -36,7 +36,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `isNull` vs. `isNotNull`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isNull` oppure `isNotNull`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `isNull` vs. `isN
);
```
You should choose the correct method for the second assertion - `isNull` vs. `isNotNull`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isNull` oppure `isNotNull`.
```js
(getUserInput) =>

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iii---put-me
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
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:

View File

@@ -1,6 +1,6 @@
---
id: 587d824f367417b2b2512c5b
title: Run Functional Tests on an API Response using Chai-HTTP IV - PUT method
title: Eseguire test funzionali su una risposta API utilizzando il metodo PUT di Chai-HTTP IV
challengeType: 2
forumTopicId: 301591
dashedName: run-functional-tests-on-an-api-response-using-chai-http-iv---put-method
@@ -8,15 +8,15 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iv---put-met
# --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/). This exercise is similar to the preceding one. Look at it for the details.
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/). Questo esercizio è simile a quello precedente. Guardalo per i dettagli.
Now that you have seen how it is done, it is your turn to do it from scratch.
Ora che hai visto come si fa, tocca a te farlo da zero.
# --instructions--
Within `tests/2_functional-tests.js`, alter the `'send {surname: "da Verrazzano"}'` test (`// #4`):
All'interno di `tests/2_functional-tests.js`, modifica il test `'send {surname: "da Verrazzano"}'` (`// #4`):
Send the following JSON response as a payload to the `/travellers` route:
Invia la seguente risposta JSON come carico utile sulla rotta `/travellers`:
```json
{
@@ -24,18 +24,18 @@ Send the following JSON response as a payload to the `/travellers` route:
}
```
Check for the following, within a `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) =>
@@ -49,7 +49,7 @@ All tests should pass
);
```
You should test for 'res.status' to be 200
Dovresti verificare che 'res.status' sia 200
```js
(getUserInput) =>
@@ -65,7 +65,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) =>
@@ -81,7 +81,7 @@ You should test for 'res.type' to be 'application/json'
);
```
You should test for 'res.body.name' to be 'Giovanni'
Dovresti verificare che 'res.body.name' sia 'Giovanni'
```js
(getUserInput) =>
@@ -97,7 +97,7 @@ You should test for 'res.body.name' to be 'Giovanni'
);
```
You should test for 'res.body.surname' to be 'da Verrazzano'
Dovresti verificare che 'res.body.surname' sia 'da Verrazzano''
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824f367417b2b2512c59
title: Run Functional Tests on API Endpoints using Chai-HTTP II
title: Eseguire test funzionali sugli endpoint API utilizzando Chai-HTTP II
challengeType: 2
forumTopicId: 301592
dashedName: run-functional-tests-on-api-endpoints-using-chai-http-ii
@@ -8,17 +8,17 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http-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 verrà costruito a partire dalla seguente bozza 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`, alter the `'Test GET /hello with your name'` test (`// #2`) to assert the `status` and the `text` response to make the test pass.
All'interno di `tests/2_functional-tests.js`, modifica il test `'Test GET /hello with your name'` (`// #2`) per asserire che le risposte `status` e `text` facciano passare i test.
Send your name in the query, appending `?name=<your_name>` to the route. The endpoint responds with `'hello <your_name>'`.
Invia il tuo nome nella query, aggiungendo `?name=<your_name>` alla rotta. L'endpoint risponde con `'hello <your_name>'`.
# --hints--
All tests should pass
Tutti i test dovrebbero essere superati
```js
(getUserInput) =>
@@ -32,7 +32,7 @@ All tests should pass
);
```
You should test for 'res.status' == 200
Dovresti verificare che 'res.status' == 200
```js
(getUserInput) =>
@@ -48,7 +48,7 @@ You should test for 'res.status' == 200
);
```
You should test for 'res.text' == 'hello Guest'
Dovresti verificare che 'res.text' == 'hello Guest'
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824e367417b2b2512c58
title: Run Functional Tests on API Endpoints using Chai-HTTP
title: Eseguire test funzionali sugli endpoint API utilizzando Chai-HTTP
challengeType: 2
forumTopicId: 301593
dashedName: run-functional-tests-on-api-endpoints-using-chai-http
@@ -8,13 +8,13 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
Mocha allows testing asyncronous operations. There is a small (BIG) difference. Can you spot it?
Mocha consente di testare operazioni asincrone. C'è una piccola (GRANDE) differenza. Riesce a individuarla?
We can test our API endpoints using a plugin, called `chai-http`. Let's see how it works. And remember, API calls are asynchronous.
Possiamo testare i nostri endpoint API utilizzando un plugin, chiamato `chai-http`. Vediamo come funziona. E ricorda, le chiamate API sono asincrone.
The following is an example of a test using `chai-http` for the `'GET /hello?name=[name] => "hello [name]"'` suite. The test sends a name string in a url query string (`?name=John`) using a `GET`request to the `server`. In the `end` method's callback function, the response object (`res`) is received and contains the `status` property. The first `assert.equal` checks if the status is equal to `200`. The second `assert.equal` checks that the response string (`res.text`) is equal to `"hello John"`.
Il seguente è un esempio di test che utilizza `chai-http` per la suite `'GET /hello?name=[name] => "hello [name]"'`. Il test invia un nome in una stringa di query URL (`?name=John`) utilizzando una richiesta `GET` al `server`. Nella funzione di callback del metodo `end`, l'oggetto di risposta (`res`) viene ricevuto e contiene la proprietà `status`. Il primo `assert.equal` controlla se lo stato è pari a `200`. Il secondo `assert.equal` verifica che la stringa di risposta (`res.text`) sia uguale a `"hello John"`.
```js
suite('GET /hello?name=[name] => "hello [name]"', function () {
@@ -34,17 +34,17 @@ suite('GET /hello?name=[name] => "hello [name]"', function () {
});
```
Notice the `done` parameter in the test's callback function. Calling it at the end without an argument is necessary to signal successful asynchronous completion.
Nota il parametro `done` nella funzione di callback del test. Chiamarlo alla fine senza un argomento è necessario per segnalare il successo del completamento asincrono.
# --instructions--
Within `tests/2_functional-tests.js`, alter the `'Test GET /hello with no name'` test (`// #1`) to assert the `status` and the `text` response to make the test pass. Do not alter the arguments passed to the asserts.
All'interno di `tests/2_functional-tests.js`, modifica il test `'Test GET /hello with no name'` (`// #1`) per asserire che le risposte `status` e `text` facciano passare i test. Non alterare gli argomenti passati alle asserzioni.
There should be no name in the query; the endpoint responds with `hello Guest`.
Non ci dovrebbe essere alcun nome nella query; l'endpoint risponde con `hello Guest`.
# --hints--
All tests should pass
Tutti i test dovrebbero essere superati
```js
(getUserInput) =>
@@ -58,7 +58,7 @@ All tests should pass
);
```
You should test for 'res.status' == 200
Dovresti verificare che 'res.status' == 200
```js
(getUserInput) =>
@@ -74,7 +74,7 @@ You should test for 'res.status' == 200
);
```
You should test for 'res.text' == 'hello Guest'
Dovresti testare che 'res.text' == 'hello Guest'
```js
(getUserInput) =>

View File

@@ -8,7 +8,7 @@ dashedName: run-functional-tests-using-a-headless-browser-ii
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
# --instructions--

View File

@@ -1,6 +1,6 @@
---
id: 587d8250367417b2b2512c5d
title: Run Functional Tests using a Headless Browser
title: Eseguire test funzionali usando un headless browser
challengeType: 2
forumTopicId: 301595
dashedName: run-functional-tests-using-a-headless-browser
@@ -8,9 +8,9 @@ dashedName: run-functional-tests-using-a-headless-browser
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
In the HTML main view we provided a input form. It sends data to the `PUT /travellers` endpoint that we used above with an Ajax request. When the request successfully completes, the client code appends a `<div>` containing the info returned by the call to the DOM. Here is an example of how to interact with this form:
Nella vista principale HTML abbiamo fornito un modulo di input. Esso invia con una richiesta Ajax i dati all'endpoint `PUT /travellers` che abbiamo usato sopra. Quando la richiesta è completata con successo, il codice client aggiunge un `<div>` contenente le informazioni restituite dalla chiamata al DOM. Ecco un esempio di come interagire con questo modulo:
```js
test('#test - submit the input "surname" : "Polo"', function (done) {
@@ -24,36 +24,36 @@ test('#test - submit the input "surname" : "Polo"', function (done) {
}
```
First, the `fill` method of the `browser` object fills the `surname` field of the form with the value `'Polo'`. Immediately after, the `pressButton` method invokes the `submit` event listener of the form. The `pressButton` method is asynchronous.
In primo luogo, il metodo `fill` dell'oggetto `browser` compila il campo `surname` del modulo con il valore `'Polo'`. Subito dopo, il metodo `pressButton` invoca l'event lister `submit` del modulo. Il metodo `pressButton` è asincrono.
Then, once a response is received from the AJAX request, a few assertions are made confirming:
Poi, una volta ricevuta una risposta dalla richiesta AJAX, vengono fatte alcune asserzioni, confermando che:
1. The status of the response is `200`
2. The text within the `<span id='name'></span>` element matches `'Marco'`
3. The text within the `<span id='surname'></span>` element matches `'Polo'`
4. There is `1` `<span id='dates'></span>` element.
1. Lo stato della risposta è `200`
2. Il testo all'interno dell'elemento `<span id='name'></span>` corrisponde a `'Marco'`
3. Il testo all'interno dell'elemento `<span id='surname'></span>` corrisponde a `'Polo'`
4. C'è `1` elemento `<span id='dates'></span>`.
Finally, the `done` callback is invoked, which is needed due to the asynchronous test.
Infine, viene invocata la callback `done`, che è necessaria a causa del test asincrono.
# --instructions--
Within `tests/2_functional-tests.js`, in the `'submit "surname" : "Colombo" - write your e2e test...'` test (`// #5`), automate filling-in and submitting the form:
All'interno di `tests/2_functional-tests.js`, nel test `'submit "surname" : "Colombo" - write your e2e test...'` (`// #5`), automatizza la compilazione e invia il modulo:
1. Fill in the form
2. Submit it pressing `'submit'` button.
1. Compila il modulo
2. Invia premendo il pulsante `'submit'`.
Within the callback:
All'interno della callback:
1. assert that status is OK `200`
2. assert that the text inside the element `span#name` is `'Cristoforo'`
3. assert that the text inside the element `span#surname` is `'Colombo'`
4. assert that the element(s) `span#dates` exist and their count is `1`
1. asserisci che lo stato è OK `200`
2. asserisci che il testo all'interno dell'elemento `span#name` è `'Cristoforo'`
3. asserisci che il testo all'interno dell'elemento `span#surname` è `'Colombo'`
4. asserisci che gli elementi `span#dates` esistono e il loro conteggio è `1`
Do not forget 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) =>
@@ -67,7 +67,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) =>
@@ -81,7 +81,7 @@ You should assert that the headless browser request succeeded.
);
```
You should assert that the text inside the element 'span#name' is 'Cristoforo'.
Dovresti asserire che il testo all'interno dell'elemento 'span#name' sia 'Cristoforo'.
```js
(getUserInput) =>
@@ -97,7 +97,7 @@ You should assert that the text inside the element 'span#name' is 'Cristoforo'.
);
```
You should assert that the text inside the element 'span#surname' is 'Colombo'.
Dovresti asserire che il testo all'interno dell'elemento 'span#surname' sia 'Colombo'.
```js
(getUserInput) =>
@@ -113,7 +113,7 @@ You should assert that the text inside the element 'span#surname' is 'Colombo'.
);
```
You should assert that the element 'span#dates' exist and its count is 1.
Dovresti asserire che l'elemento 'span#dates' esiste e il suo conteggio sia 1.
```js
(getUserInput) =>

View File

@@ -1,45 +1,45 @@
---
id: 587d824f367417b2b2512c5c
title: Simulate Actions Using a Headless Browser
title: Simulare azioni usando un headless browser
challengeType: 2
dashedName: simulate-actions-using-a-headless-browser
---
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
In the next challenges we are going to simulate the human interaction with a page using a device called 'Headless Browser'.
Nelle prossime sfide simuleremo l'interazione umana con una pagina utilizzando un dispositivo chiamato 'Headless Browser' (browser senza testa).
A headless browser is a web browser without a graphical user interface. This kind of tool is particularly useful for testing web pages, as it is able to render and understand HTML, CSS, and JavaScript the same way a browser would.
Un headless browser è un browser web senza interfaccia utente grafica. Questo tipo di strumento è particolarmente utile per testare le pagine web, poiché è in grado di renderizzare e capire HTML, CSS, e JavaScript proprio come farebbe un browser.
For these challenges we are using Zombie.JS. It's a lightweight browser which is totally based on JS, without relying on additional binaries to be installed. This feature makes it usable in an environment such as Replit. There are many other (more powerful) options.
Per queste sfide stiamo usando Zombie.JS. È un browser leggero che è totalmente basato su JS, che non richiede binari aggiuntivi da installare. Questa funzione lo rende utilizzabile in un ambiente come Replit. Ci sono molte altre opzioni (più potenti).
Mocha allows you to prepare the ground running some code before the actual tests. This can be useful for example to create items in the database, which will be used in the successive tests.
Mocha ti consente di preparare il terreno eseguendo del codice prima dei test effettivi. Questo può essere utile, ad esempio, per creare elementi nel database, che saranno utilizzati nei test successivi.
With a headless browser, before the actual testing, we need to **visit** the page we are going to inspect. The `suiteSetup` 'hook' is executed only once at the suite startup. Other different hook types can be executed before each test, after each test, or at the end of a suite. See the Mocha docs for more information.
Con un headless browser, prima del test effettivo, abbiamo bisogno di **visitare** la pagina che stiamo per controllare. L'hook' `suiteSetup` viene eseguito solo una volta all'avvio della suite. Altri tipi di hook possono essere esuiti prima di ogni test, dopo ogni test, o alla fine della suite. Vedi la documentazione di Mocha per maggiori informazioni.
# --instructions--
Within `tests/2_functional-tests.js`, immediately after the `Browser` declaration, add your project URL to the `site` property of the variable:
All'interno di `tests/2_functional-tests.js`, immediatamente dopo la dichiarazione `Browser`, aggiungi l'URL del tuo progetto alla proprietà `site` della variabile:
```js
Browser.site = 'https://sincere-cone.gomix.me'; // Your URL here
```
If you are testing on a local environment replace the line above with
Se stai testando su un ambiente locale, sostituisci la riga precedente con
```js
Browser.localhost('example.com', process.env.PORT || 3000);
```
Within `tests/2_functional-tests.js`, at the root level of the `'Functional Tests with Zombie.js'` suite, instantiate a new instance of the `Browser` object with the following code:
All'interno di `tests/2_functional-tests.js`, al livello root della suite `'Functional Tests with Zombie.js'`, crea una nuova istanza dell'oggetto `Browser` con il seguente codice:
```js
const browser = new Browser();
```
Then, use the `suiteSetup` hook to direct the `browser` to the `/` route with the following code:
Quindi, utilizza l'hook `suiteSetup` per indirizzare il `browser` al percorso `/` con il seguente codice:
```js
suiteSetup(function(done) {
@@ -49,7 +49,7 @@ suiteSetup(function(done) {
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824b367417b2b2512c49
title: Test for Truthiness
title: Testare la veridicità
challengeType: 2
forumTopicId: 301596
dashedName: test-for-truthiness
@@ -8,9 +8,9 @@ dashedName: test-for-truthiness
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`isTrue()` will test for the boolean value `true` and `isNotTrue()` will pass when given anything but the boolean value of `true`.
`isTrue()` testa per il valore boleano `true` e `isNotTrue()` passa per qualsiasi cosa che non sia il valore booleano `true`.
```js
assert.isTrue(true, 'this will pass with the boolean value true');
@@ -18,15 +18,15 @@ assert.isTrue('true', 'this will NOT pass with the string value "true"');
assert.isTrue(1, 'this will NOT pass with the number value 1');
```
`isFalse()` and `isNotFalse()` also exist, and behave similarly to their true counterparts except they look for the boolean value of `false`.
Esistono anche `isFalse()` e `isNotFalse()`, si comportano in maniera simile alle loro controparti con true tranne per il fatto che testano per il valore booleano `false`.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#4` in the `Basic Assertions` suite, change each `assert` to either `assert.isTrue` or `assert.isNotTrue` 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 `#4` nella suite `Basic Assertions`, cambia ogni `assert` con `assert.isTrue` oppure `assert.isNotTrue` per fare passare il test (dovrebbe essere uguale a `true`). Non cambiare gli argomenti passati alle asserzioni.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -40,7 +40,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `isTrue` vs. `isNotTrue`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isTrue` oppure `isNotTrue`.
```js
(getUserInput) =>
@@ -54,7 +54,7 @@ You should choose the correct method for the first assertion - `isTrue` vs. `isN
);
```
You should choose the correct method for the second assertion - `isTrue` vs. `isNotTrue`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isTrue` oppure `isNotTrue`.
```js
(getUserInput) =>
@@ -72,7 +72,7 @@ You should choose the correct method for the second assertion - `isTrue` vs. `is
);
```
You should choose the correct method for the third assertion - `isTrue` vs. `isNotTrue`.
Dovresti scegliere il metodo corretto per la terza asserzione - `isTrue` oppure `isNotTrue`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824d367417b2b2512c53
title: Test if a String Contains a Substring
title: Verificare se una stringa contiene una sottostringa
challengeType: 2
forumTopicId: 301597
dashedName: test-if-a-string-contains-a-substring
@@ -8,17 +8,17 @@ dashedName: test-if-a-string-contains-a-substring
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`include()` and `notInclude()` work for strings too! `include()` asserts that the actual string contains the expected substring.
`include()` e `notInclude()` funzionano anche per le stringhe! `include()` afferma che la stringa attuale contiene la sottostringa prevista.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#14` in the `Strings` suite, change each `assert` to either `assert.include` or `assert.notInclude` 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 `#14`, nella suite `Strings`, cambia ogni asserzione `assert` in `assert.include` o `assert.notInclude` 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 - `include` vs. `notInclude`.
Dovresti scegliere il metodo corretto per la prima asserzione - `include` oppure `notInclude`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `include` vs. `no
);
```
You should choose the correct method for the second assertion - `include` vs. `notInclude`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `include` oppure `notInclude`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824c367417b2b2512c4f
title: Test if a Value Falls within a Specific Range
title: Verificare se un valore cade all'interno di uno specifico intervallo
challengeType: 2
forumTopicId: 301598
dashedName: test-if-a-value-falls-within-a-specific-range
@@ -8,23 +8,23 @@ dashedName: test-if-a-value-falls-within-a-specific-range
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
```javascript
.approximately(actual, expected, delta, [message])
```
Asserts that the `actual` is equal to `expected`, to within a +/- `delta` range.
Asserisce che `actual` sia uguale a `expected`, all'interno di un intervallo di +/- `delta`.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#10` in the `Comparisons` suite, change each `assert` to `assert.approximately` to make the test pass (should evaluate to `true`).
All'interno di `tests/1_unit-tests.js`, sotto il test etichettato con `#10`, nella suite `Comparisons`, cambia ogni asserzione `assert` in `assert.approximately` per far passare il test (dovrebbe risultare `true`).
Choose the minimum range (3rd parameter) to make the test always pass. It should be less than 1.
Scegli l'intervallo minimo (terzo parametro) per far passare sempre il test. Dovrebbe essere inferiore a 1.
# --hints--
All tests should pass.
Tutti i test dovrebbero essere superati.
```js
(getUserInput) =>
@@ -38,7 +38,7 @@ All tests should pass.
);
```
You should choose the correct range for the first assertion - `approximately(actual, expected, range)`.
Dovresti scegliere l'intervallo corretto per la prima asserzione - `approximately(actual, expected, range)`.
```js
(getUserInput) =>
@@ -57,7 +57,7 @@ You should choose the correct range for the first assertion - `approximately(act
);
```
You should choose the correct range for the second assertion - `approximately(actual, expected, range)`.
Dovresti scegliere l'intervallo corretto per la seconda asserzione - `approximately(actual, expected, range)`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824d367417b2b2512c52
title: Test if a Value is a String
title: Verificare se un valore è una stringa
challengeType: 2
forumTopicId: 301599
dashedName: test-if-a-value-is-a-string
@@ -8,17 +8,17 @@ dashedName: test-if-a-value-is-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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`isString` or `isNotString` asserts that the actual value is a string.
`isString` or `isNotString` asserisce che il valore effettivo è una stringa.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#13` in the `Strings` suite, change each `assert` to either `assert.isString` or `assert.isNotString` 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 `#13`, nella suite `Strings`, cambia ogni asserzione `assert` in `assert.isString` o `assert.isNotString` 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 - `isString` vs. `isNotString`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isString` oppure `isNotString`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `isString` vs. `i
);
```
You should choose the correct method for the second assertion - `isString` vs. `isNotString`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isString` oppure `isNotString`.
```js
(getUserInput) =>
@@ -68,7 +68,7 @@ You should choose the correct method for the second assertion - `isString` vs. `
);
```
You should choose the correct method for the third assertion - `isString` vs. `isNotString`.
Dovresti scegliere il metodo corretto per la terza asserzione - `isString` oppure `isNotString`.
```js
(getUserInput) =>

View File

@@ -8,7 +8,7 @@ dashedName: test-if-a-value-is-an-array
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
# --instructions--

View File

@@ -1,6 +1,6 @@
---
id: 587d824e367417b2b2512c56
title: Test if a Value is of a Specific Data Structure Type
title: Verificare se un valore è di un tipo specifico di struttura dei dati
challengeType: 2
forumTopicId: 301601
dashedName: test-if-a-value-is-of-a-specific-data-structure-type
@@ -8,17 +8,17 @@ dashedName: test-if-a-value-is-of-a-specific-data-structure-type
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`#typeOf` asserts that value's type is the given string, as determined by `Object.prototype.toString`.
`#typeOf` asserisce che il tipo del valore è la stringa data, come determinato da `Object.prototype.toString`.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#17` in the `Objects` suite, change each `assert` to either `assert.typeOf` or `assert.notTypeOf` 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 `#17`, nella suite `Objects`, cambia ogni asserzione `assert` in `assert.typeOf` o `assert.notTypeOf` 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 - `typeOf` vs. `notTypeOf`.
Dovresti scegliere il metodo corretto per la prima asserzione - `typeOf` oppure `notTypeOf`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `typeOf` vs. `not
);
```
You should choose the correct method for the second assertion - `typeOf` vs. `notTypeOf`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `typeOf` oppure `notTypeOf`.
```js
(getUserInput) =>
@@ -68,7 +68,7 @@ You should choose the correct method for the second assertion - `typeOf` vs. `no
);
```
You should choose the correct method for the third assertion - `typeOf` vs. `notTypeOf`.
Dovresti scegliere il metodo corretto per la terza asserzione - `typeOf` oppure `notTypeOf`.
```js
(getUserInput) =>
@@ -86,7 +86,7 @@ You should choose the correct method for the third assertion - `typeOf` vs. `not
);
```
You should choose the correct method for the fourth assertion - `typeOf` vs. `notTypeOf`.
Dovresti scegliere il metodo corretto per la quarta asserzione - `typeOf` oppure `notTypeOf`.
```js
(getUserInput) =>
@@ -104,7 +104,7 @@ You should choose the correct method for the fourth assertion - `typeOf` vs. `no
);
```
You should choose the correct method for the fifth assertion - `typeOf` vs. `notTypeOf`.
Dovresti scegliere il metodo corretto per la quinta asserzione - `typeOf` oppure `notTypeOf`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824b367417b2b2512c47
title: Test if a Variable or Function is Defined
title: Verificare se una variabile o una funzione è definita
challengeType: 2
forumTopicId: 301602
dashedName: test-if-a-variable-or-function-is-defined
@@ -8,15 +8,15 @@ dashedName: test-if-a-variable-or-function-is-defined
# --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 verrà costruito a partire dalla seguente bozza 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 `#2` in the `Basic Assertions` suite, change each `assert` to either `assert.isDefined()` or `assert.isUndefined()` 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 `#2`, nella suite `Basic Assertions`, cambia ogni asserzione `assert` in `assert.isDefined()` o `assert.isUndefined()` 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) =>
@@ -30,7 +30,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `isDefined` vs. `isUndefined`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isDefined` oppure `isUndefined`.
```js
(getUserInput) =>
@@ -48,7 +48,7 @@ You should choose the correct method for the first assertion - `isDefined` vs. `
);
```
You should choose the correct method for the second assertion - `isDefined` vs. `isUndefined`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isDefined` oppure `isUndefined`.
```js
(getUserInput) =>
@@ -66,7 +66,7 @@ You should choose the correct method for the second assertion - `isDefined` vs.
);
```
You should choose the correct method for the third assertion - `isDefined` vs. `isUndefined`.
Dovresti scegliere il metodo corretto per la terza asserzione - `isDefined` oppure `isUndefined`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824d367417b2b2512c51
title: Test if an Array Contains an Item
title: Verificare se un array contiene un elemento
challengeType: 2
forumTopicId: 301603
dashedName: test-if-an-array-contains-an-item
@@ -8,15 +8,15 @@ dashedName: test-if-an-array-contains-an-item
# --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 verrà costruito a partire dalla seguente bozza 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 `#12` in the `Arrays` suite, change each `assert` to either `assert.include` or `assert.notInclude` 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 `#12`, nella suite `Arrays`, cambia ogni asserzione `assert` in `assert.include` o `assert.notInclude` 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) =>
@@ -30,7 +30,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `include` vs. `notInclude`.
Dovresti scegliere il metodo corretto per la prima asserzione - `include` oppure `notInclude`.
```js
(getUserInput) =>
@@ -48,7 +48,7 @@ You should choose the correct method for the first assertion - `include` vs. `no
);
```
You should choose the correct method for the second assertion - `include` vs. `notInclude`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `include` oppure `notInclude`.
```js
(getUserInput) =>

View File

@@ -8,7 +8,7 @@ dashedName: test-if-an-object-has-a-property
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`property` asserisce che l'oggetto effettivo ha una data proprietà.

View File

@@ -8,7 +8,7 @@ dashedName: test-if-an-object-is-an-instance-of-a-constructor
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`#instanceOf` afferma che un oggetto è un'istanza di un costruttore.

View File

@@ -1,6 +1,6 @@
---
id: 587d824c367417b2b2512c4e
title: Test if One Value is Below or At Least as Large as Another
title: Verificare se un valore è minore o uguale a un altro
challengeType: 2
forumTopicId: 301606
dashedName: test-if-one-value-is-below-or-at-least-as-large-as-another
@@ -8,15 +8,15 @@ dashedName: test-if-one-value-is-below-or-at-least-as-large-as-another
# --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 verrà costruito a partire dalla seguente bozza 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 `#9` in the `Comparisons` suite, change each `assert` to either `assert.isBelow` or `assert.isAtLeast` 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 `#9`, nella suite `Comparisons`, cambia ogni asserzione `assert` in `assert.isBelow` o `assert.isAtLeast` 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) =>
@@ -30,7 +30,7 @@ All tests should pass.
);
```
You should choose the correct method for the first assertion - `isBelow` vs. `isAtLeast`.
Dovresti scegliere il metodo corretto per la prima asserzione - `isBelow` vs. `isAtLeast`.
```js
(getUserInput) =>
@@ -48,7 +48,7 @@ You should choose the correct method for the first assertion - `isBelow` vs. `is
);
```
You should choose the correct method for the second assertion - `isBelow` vs. `isAtLeast`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `isBelow` vs. `isAtLeast`.
```js
(getUserInput) =>
@@ -66,7 +66,7 @@ You should choose the correct method for the second assertion - `isBelow` vs. `i
);
```
You should choose the correct method for the third assertion - `isBelow` vs. `isAtLeast`.
Dovresti scegliere il metodo corretto per la terza asserzione - `isBelow` vs. `isAtLeast`.
```js
(getUserInput) =>
@@ -80,7 +80,7 @@ You should choose the correct method for the third assertion - `isBelow` vs. `is
);
```
You should choose the correct method for the fourth assertion - `isBelow` vs. `isAtLeast`.
Dovresti scegliere il metodo corretto per la quarta asserzione - `isBelow` vs. `isAtLeast`.
```js
(getUserInput) =>

View File

@@ -8,7 +8,7 @@ dashedName: use-assert-isok-and-assert-isnotok
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`isOk()` verificherà se un valore è veritiero e `isNotOk()` verificherà se un valore è falso.

View File

@@ -8,7 +8,7 @@ dashedName: use-regular-expressions-to-test-a-string
# --description--
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/).
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`match()` afferma che il valore effettivo corrisponde al secondo argomento espressione regolare.

View File

@@ -1,6 +1,6 @@
---
id: 587d824b367417b2b2512c4a
title: Use the Double Equals to Assert Equality
title: Usare il doppio uguale per affermare l'uguaglianza
challengeType: 2
forumTopicId: 301609
dashedName: use-the-double-equals-to-assert-equality
@@ -8,17 +8,17 @@ dashedName: use-the-double-equals-to-assert-equality
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`equal()` compares objects using `==`.
`equal()` confronta oggetti usando `==`.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#5` in the `Equality` suite, change each `assert` to either `assert.equal` or `assert.notEqual` 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 `#5`, nella suite `Equality`, cambia ogni asserzione `assert` in `assert.equal` o `assert.notEqual` 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 - `equal` vs. `notEqual`.
Dovresti scegliere il metodo corretto per la prima asserzione - `equal` oppure `notEqual`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `equal` vs. `notE
);
```
You should choose the correct method for the second assertion - `equal` vs. `notEqual`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `equal` oppure `notEqual`.
```js
(getUserInput) =>
@@ -68,7 +68,7 @@ You should choose the correct method for the second assertion - `equal` vs. `not
);
```
You should choose the correct method for the third assertion - `equal` vs. `notEqual`.
Dovresti scegliere il metodo corretto per la terza asserzione - `equal` oppure `notEqual`.
```js
(getUserInput) =>
@@ -86,7 +86,7 @@ You should choose the correct method for the third assertion - `equal` vs. `notE
);
```
You should choose the correct method for the fourth assertion - `equal` vs. `notEqual`.
Dovresti scegliere il metodo corretto per la quarta asserzione - `equal` oppure `notEqual`.
```js
(getUserInput) =>

View File

@@ -1,6 +1,6 @@
---
id: 587d824b367417b2b2512c4b
title: Use the Triple Equals to Assert Strict Equality
title: Usare il triplo uguale per affermare l'uguaglianza stretta
challengeType: 2
forumTopicId: 301610
dashedName: use-the-triple-equals-to-assert-strict-equality
@@ -8,17 +8,17 @@ dashedName: use-the-triple-equals-to-assert-strict-equality
# --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 verrà costruito a partire dalla seguente bozza su [Replit](https://replit.com/github/freeCodeCamp/boilerplate-mochachai), o clonato da [GitHub](https://github.com/freeCodeCamp/boilerplate-mochachai/).
`strictEqual()` compares objects using `===`.
`strictEqual()` confronta oggetti usando `===`.
# --instructions--
Within `tests/1_unit-tests.js` under the test labelled `#6` in the `Equality` suite, change each `assert` to either `assert.strictEqual` or `assert.notStrictEqual` 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 `#6`, nella suite `Equality`, cambia ogni asserzione `assert` in `assert.strictEqual` o `assert.notStrictEqual` 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 - `strictEqual` vs. `notStrictEqual`.
Dovresti scegliere il metodo corretto per la prima asserzione - `strictEqual` oppure `notStrictEqual`.
```js
(getUserInput) =>
@@ -50,7 +50,7 @@ You should choose the correct method for the first assertion - `strictEqual` vs.
);
```
You should choose the correct method for the second assertion - `strictEqual` vs. `notStrictEqual`.
Dovresti scegliere il metodo corretto per la seconda asserzione - `strictEqual` oppure `notStrictEqual`.
```js
(getUserInput) =>
@@ -64,7 +64,7 @@ You should choose the correct method for the second assertion - `strictEqual` vs
);
```
You should choose the correct method for the third assertion - `strictEqual` vs. `notStrictEqual`.
Dovresti scegliere il metodo corretto per la terza asserzione - `strictEqual` oppure `notStrictEqual`.
```js
(getUserInput) =>
@@ -82,7 +82,7 @@ You should choose the correct method for the third assertion - `strictEqual` vs.
);
```
You should choose the correct method for the fourth assertion - `strictEqual` vs. `notStrictEqual`.
Dovresti scegliere il metodo corretto per la quarta asserzione - `strictEqual` oppure `notStrictEqual`.
```js
(getUserInput) =>

View File

@@ -11,7 +11,7 @@ dashedName: american-british-translator
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:
- Clonare [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/) e completare il tuo progetto localmente.
- Usare [il nostro progetto di avvio Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator) per completare il tuo progetto.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator) per completare il tuo progetto.
- Usare un costruttore di siti a tua scelta per completare il progetto. Assicurati di incorporare tutti i file del nostro repository GitHub.
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`.

View File

@@ -1,6 +1,6 @@
---
id: 587d8249367417b2b2512c42
title: Issue Tracker
title: Tracciatore di problemi
challengeType: 4
forumTopicId: 301569
dashedName: issue-tracker
@@ -8,42 +8,42 @@ dashedName: issue-tracker
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://issue-tracker.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://issue-tracker.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-issuetracker/) and complete your project locally.
- Use [this Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker) 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.
- Clonare [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-project-issuetracker/) e completare il tuo progetto localmente.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker) per completare il tuo progetto.
- Usare un costruttore di siti a 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--
- Complete the necessary routes in `/routes/api.js`
- Create all of the functional tests in `tests/2_functional-tests.js`
- Copy the `sample.env` file to `.env` and set the variables appropriately
- To run the tests uncomment `NODE_ENV=test` in your `.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"
- Completa le rotte necessarie in `/routes/api.js`
- Crea tutti i test funzionali in `tests/2_functional-tests.js`
- Copia il file `sample.env` su `.env` e imposta le variabili in modo appropriato
- Per eseguire i test togli i commenti dalla riga `NODE_ENV=test` nel tuo 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/2_functional-tests.js`:
Scrivi i seguenti test in `tests/2_functional-tests.js`:
- Create an issue with every field: POST request to `/api/issues/{project}`
- Create an issue with only required fields: POST request to `/api/issues/{project}`
- Create an issue with missing required fields: POST request to `/api/issues/{project}`
- View issues on a project: GET request to `/api/issues/{project}`
- View issues on a project with one filter: GET request to `/api/issues/{project}`
- View issues on a project with multiple filters: GET request to `/api/issues/{project}`
- Update one field on an issue: PUT request to `/api/issues/{project}`
- Update multiple fields on an issue: PUT request to `/api/issues/{project}`
- Update an issue with missing `_id`: PUT request to `/api/issues/{project}`
- Update an issue with no fields to update: PUT request to `/api/issues/{project}`
- Update an issue with an invalid `_id`: PUT request to `/api/issues/{project}`
- Delete an issue: DELETE request to `/api/issues/{project}`
- Delete an issue with an invalid `_id`: DELETE request to `/api/issues/{project}`
- Delete an issue with missing `_id`: DELETE request to `/api/issues/{project}`
- Crea un'issue con ogni campo: richiesta POST a `/api/issues/{project}`
- Crea un'issue con soli campi obbligatori: richiesta POST a `/api/issues/{project}`
- Crea un'issue con i campi obbligatori mancanti: richiesta POST a `/api/issues/{project}`
- Visualizza i gli issue di un progetto: richiesta GET a `/api/issues/{project}`
- Visualizza gli issue di un progetto con un filtro: richiesta GET a `/api/issues/{project}`
- Visualizza gli issue di un progetto con più filtri: richiesta GET a `/api/issues/{project}`
- Aggiorna un campo in un issue: richiesta PUT a `/api/issues/{project}`
- Aggiorna più campi in un issue: richiesta PUT a `/api/issues/{project}`
- Aggiorna un issue con `_id` mancante: richiesta PUT a `/api/issues/{project}`
- Aggiorna un issue che non ha campi da aggiornare: richiesta PUT a `/api/issues/{project}`
- Aggiorna un issue con `_id` invalido: richiesta PUT a `/api/issues/{project}`
- Elimina un issue: richiesta DELETE a `/api/issues/{project}`
- Elimina un issue con `_id` invalido: richiesta DELETE a `/api/issues/{project}`
- Elimina un issue con `_id` mancante: richiesta DELETE a `/api/issues/{project}`
# --hints--
You can provide your own project, not the example URL.
È necessario fornire il proprio progetto, non l'URL di esempio.
```js
(getUserInput) => {
@@ -51,7 +51,7 @@ You can provide your own project, not the example URL.
};
```
You can send a `POST` request to `/api/issues/{projectname}` with form data containing the required fields `issue_title`, `issue_text`, `created_by`, and optionally `assigned_to` and `status_text`.
Puoi inviare una richiesta `POST` a `/api/issues/{projectname}` con i dati del modulo contenenti i campi obbligatori `issue_title`, `issue_text`, `created_by`, e opzionalmente `assigned_to` e `status_text`.
```js
async (getUserInput) => {
@@ -73,7 +73,7 @@ async (getUserInput) => {
};
```
The `POST` request to `/api/issues/{projectname}` will return the created object, and must include all of the submitted fields. Excluded optional fields will be returned as empty strings. Additionally, include `created_on` (date/time), `updated_on` (date/time), `open` (boolean, `true` for open - default value, `false` for closed), and `_id`.
La richiesta `POST` a `/api/issues/{projectname}` restituirà l'oggetto creato, e deve includere tutti i campi inviati. I campi opzionali esclusi saranno restituiti come stringhe vuote. Inoltre, includi `created_on` (data/ora), `updated_on` (data/ora), `open` (booleano, `true` per open - valore predefinito, `false` per chiuso), e `_id`.
```js
async (getUserInput) => {
@@ -107,7 +107,7 @@ async (getUserInput) => {
};
```
If you send a `POST` request to `/api/issues/{projectname}` without the required fields, returned will be the error `{ error: 'required field(s) missing' }`
Se invii una richiesta `POST` a `/api/issues/{projectname}` senza i campi richiesti, deve essere restituito un errore `{ error: 'required field(s) missing' }`
```js
async (getUserInput) => {
@@ -125,7 +125,7 @@ async (getUserInput) => {
};
```
You can send a `GET` request to `/api/issues/{projectname}` for an array of all issues for that specific `projectname`, with all the fields present for each issue.
È possibile inviare una richiesta `GET` a `/api/issues/{projectname}` per un array di tutti gli issue per quel specifico `projectname`, con tutti i campi presenti per ogni issue.
```js
async (getUserInput) => {
@@ -172,7 +172,7 @@ async (getUserInput) => {
};
```
You can send a `GET` request to `/api/issues/{projectname}` and filter the request by also passing along any field and value as a URL query (ie. `/api/issues/{project}?open=false`). You can pass one or more field/value pairs at once.
Puoi inviare una richiesta `GET` a `/api/issues/{projectname}` e filtrare la richiesta passando anche qualsiasi campo e valore come una query di URL (es. `/api/issues/{project}?open=false`). È possibile passare una o più coppie di campo/valore contemporaneamente.
```js
async (getUserInput) => {
@@ -213,7 +213,7 @@ async (getUserInput) => {
};
```
You can send a `PUT` request to `/api/issues/{projectname}` with an `_id` and one or more fields to update. On success, the `updated_on` field should be updated, and returned should be `{ result: 'successfully updated', '_id': _id }`.
Puoi inviare una richiesta `PUT` a `/api/issues/{projectname}` con un `_id` e uno o più campi da aggiornare. Al successo, il campo `updated_on` dovrebbe essere aggiornato, e dovrebbe essere restituito `{ result: 'successfully updated', '_id': _id }`.
```js
async (getUserInput) => {
@@ -248,7 +248,7 @@ async (getUserInput) => {
};
```
When the `PUT` request sent to `/api/issues/{projectname}` does not include an `_id`, the return value is `{ error: 'missing _id' }`.
Quando la richiesta `PUT` inviata a `/api/issues/{projectname}` non include un `_id`, deve essere restuito `{ error: 'missing _id' }`.
```js
async (getUserInput) => {
@@ -264,7 +264,7 @@ async (getUserInput) => {
};
```
When the `PUT` request sent to `/api/issues/{projectname}` does not include update fields, the return value is `{ error: 'no update field(s) sent', '_id': _id }`. On any other error, the return value is `{ error: 'could not update', '_id': _id }`.
Quando la richiesta `PUT` inviata a `/api/issues/{projectname}` non include campi da aggiornare, deve essere restuito `{ error: 'no update field(s) sent', '_id': _id }`. Su qualsiasi altro errore, il valore restituito deve essere `{ error: 'could not update', '_id': _id }`.
```js
async (getUserInput) => {
@@ -294,7 +294,7 @@ async (getUserInput) => {
};
```
You can send a `DELETE` request to `/api/issues/{projectname}` with an `_id` to delete an issue. If no `_id` is sent, the return value is `{ error: 'missing _id' }`. On success, the return value is `{ result: 'successfully deleted', '_id': _id }`. On failure, the return value is `{ error: 'could not delete', '_id': _id }`.
Puoi inviare una richiesta `DELETE` a `/api/issues/{projectname}` con un `_id` per eliminare un issue. Se non viene inviato un `_id` , deve essere restuito `{ error: 'missing _id' }`. Al successo, deve essere restituito `{ result: 'successfully deleted', '_id': _id }`. Al fallimento, il valore restituito deve essere `{ error: 'could not delete', '_id': _id }`.
```js
async (getUserInput) => {
@@ -336,7 +336,7 @@ async (getUserInput) => {
};
```
All 14 functional tests are complete and passing.
Tutti i 14 test funzionali sono completi e passano.
```js
async (getUserInput) => {

View File

@@ -1,6 +1,6 @@
---
id: 587d8249367417b2b2512c41
title: Metric-Imperial Converter
title: Convertitore Metrico-Imperiale
challengeType: 4
forumTopicId: 301570
dashedName: metric-imperial-converter
@@ -8,52 +8,52 @@ dashedName: metric-imperial-converter
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://metric-imperial-converter.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://metric-imperial-converter.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-metricimpconverter/) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-metricimpconverter) 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.
- Clonare [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/) e completare il tuo progetto localmente.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-metricimpconverter) per completare il tuo progetto.
- Usare un costruttore di siti a 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--
- Complete the necessary conversion logic in `/controllers/convertHandler.js`
- Complete the necessary routes in `/routes/api.js`
- Copy the `sample.env` file to `.env` and set the variables appropriately
- To run the tests uncomment `NODE_ENV=test` in your `.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"
- Completa la logica di conversione necessaria in `/controllers/convertHandler.js`
- Completa le rotte necessarie in `/routes/api.js`
- Copia il file `sample.env` su `.env` e imposta le variabili in modo appropriato
- Per eseguire i test togli i commenti dalla riga `NODE_ENV=test` nel tuo 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`:
- `convertHandler` should correctly read a whole number input.
- `convertHandler` should correctly read a decimal number input.
- `convertHandler` should correctly read a fractional input.
- `convertHandler` should correctly read a fractional input with a decimal.
- `convertHandler` should correctly return an error on a double-fraction (i.e. `3/2/3`).
- `convertHandler` should correctly default to a numerical input of `1` when no numerical input is provided.
- `convertHandler` should correctly read each valid input unit.
- `convertHandler` should correctly return an error for an invalid input unit.
- `convertHandler` should return the correct return unit for each valid input unit.
- `convertHandler` should correctly return the spelled-out string unit for each valid input unit.
- `convertHandler` should correctly convert `gal` to `L`.
- `convertHandler` should correctly convert `L` to `gal`.
- `convertHandler` should correctly convert `mi` to `km`.
- `convertHandler` should correctly convert `km` to `mi`.
- `convertHandler` should correctly convert `lbs` to `kg`.
- `convertHandler` should correctly convert `kg` to `lbs`.
- `convertHandler` dovrebbe leggere correttamente un numero intero inserito.
- `convertHandler` dovrebbe leggere correttamente un numero decimale inserito.
- `convertHandler` dovrebbe leggere correttamente una frazione inserita.
- `convertHandler` dovrebbe leggere correttamente un input frazionario con un decimale.
- `convertHandler` dovrebbe restituire correttamente un errore su una doppia frazione (cioè `3/2/3`).
- `convertHandler` dovrebbe essere correttamente predefinito con un input numerico di `1` quando non viene fornito alcun input numerico.
- `convertHandler` dovrebbe leggere correttamente ogni input valido.
- `convertHandler` dovrebbe restituire un errore per ogni input non valido.
- `convertHandler` dovrebbe restituire l'unità di ritorno corretta per ogni unità di input valida.
- `convertHandler` dovrebbe restituire correttamente l'unità di misura scritta per esteso per ogni unità di input valida.
- `convertHandler` dovrebbe convertire correttamente `gal` in `L`.
- `convertHandler` dovrebbe convertire correttamente `L` in `gal`.
- `convertHandler` dovrebbe convertire correttamente `mi` in `km`.
- `convertHandler` dovrebbe convertire correttamente `km` in `mi`.
- `convertHandler` dovrebbe convertire correttamente `lbs` in `kg`.
- `convertHandler` dovrebbe convertire correttamente `kg` in `lbs`.
Write the following tests in `tests/2_functional-tests.js`:
Scrivi i seguenti test in `tests/2_functional-tests.js`:
- Convert a valid input such as `10L`: `GET` request to `/api/convert`.
- Convert an invalid input such as `32g`: `GET` request to `/api/convert`.
- Convert an invalid number such as `3/7.2/4kg`: `GET` request to `/api/convert`.
- Convert an invalid number AND unit such as `3/7.2/4kilomegagram`: `GET` request to `/api/convert`.
- Convert with no number such as `kg`: `GET` request to `/api/convert`.
- Converti un input valido come `10L`: richiesta `GET` a `/api/convert`.
- Converti un input non valido come `32g`: richiesta `GET` a `/api/convert`.
- Converti un input non valido come `3/7.2/4kg`: richiesta `GET` a `/api/convert`.
- Converti un input non valido come `3/7.2/4kilomegagram`: richiesta `GET` a `/api/convert`.
- Converti un input senza alcun numero come `kg`: richiesta `GET` a `/api/convert`.
# --hints--
You can provide your own project, not the example URL.
È necessario fornire il proprio progetto, non l'URL di esempio.
```js
getUserInput => {
@@ -65,13 +65,13 @@ getUserInput => {
};
```
You can `GET` `/api/convert` with a single parameter containing an accepted number and unit and have it converted. (Hint: Split the input by looking for the index of the first character which will mark the start of the unit)
È possibile ottenere (`GET`) `/api/convert` con un singolo parametro contenente un numero e un'unità validi e convertirlo. (Suggerimento: Dividi l'input cercando l'indice del primo carattere, che segnerà l'inizio dell'unità)
```js
```
You can convert `'gal'` to `'L'` and vice versa. (1 gal to 3.78541 L)
Puoi convertire `'gal'` in `'L'` e viceversa. (1 gal in 3.78541 L)
```js
async getUserInput => {
@@ -94,7 +94,7 @@ async getUserInput => {
};
```
You can convert `'lbs'` to `'kg'` and vice versa. (1 lbs to 0.453592 kg)
Puoi convertire `'lbs'` in `'kg'` e viceversa. (1 lbs in 0,453592 kg)
```js
async getUserInput => {
@@ -117,7 +117,7 @@ async getUserInput => {
};
```
You can convert `'mi'` to `'km'` and vice versa. (1 mi to 1.60934 km)
Puoi convertire `'mi'` in `'km'` e viceversa. (1 mi in 1.60934 km)
```js
async getUserInput => {
@@ -140,7 +140,7 @@ async getUserInput => {
};
```
All incoming units should be accepted in both upper and lower case, but should be returned in both the `initUnit` and `returnUnit` in lower case, except for liter, which should be represented as an uppercase `'L'`.
Tutte le unità in entrata dovrebbero essere accettate sia in maiuscolo che in minuscolo, ma dovrebbero essere restituite in minuscolo sia per `initUnit` che `returnUnit`, ad eccezione del litro, che dovrebbe essere rappresentato come una `'L'` maiuscola.
```js
async getUserInput => {
@@ -163,7 +163,7 @@ async getUserInput => {
};
```
If the unit of measurement is invalid, returned will be `'invalid unit'`.
Se l'unità di misura non è valida, sarà restituito `'invalid unit'`.
```js
async getUserInput => {
@@ -176,7 +176,7 @@ async getUserInput => {
};
```
If the number is invalid, returned will be `'invalid number'`.
Se il numero non è valido, sarà restituito `'invalid number'`.
```js
async getUserInput => {
@@ -191,7 +191,7 @@ async getUserInput => {
};
```
If both the unit and number are invalid, returned will be `'invalid number and unit'`.
Se sia l'unità che il numero non sono validi, sarà restituito `'invalid number and unit'`.
```js
async getUserInput => {
@@ -209,7 +209,7 @@ async getUserInput => {
};
```
You can use fractions, decimals or both in the parameter (ie. 5, 1/2, 2.5/6), but if nothing is provided it will default to 1.
È possibile utilizzare frazioni, decimali o entrambi nel parametro (es. 5, 1/2, 2.5/6), ma se non viene fornito nulla il valore predefinito sarà 1.
```js
async getUserInput => {
@@ -240,7 +240,7 @@ async getUserInput => {
};
```
Your return will consist of the `initNum`, `initUnit`, `returnNum`, `returnUnit`, and `string` spelling out units in the format `'{initNum} {initUnitString} converts to {returnNum} {returnUnitString}'` with the result rounded to 5 decimals.
Il tuo risultato consisterà in `initNum`, `initUnit`, `returnNum`, `returnUnit`, e `string` che indica le unità nel formato `'{initNum} {initUnitString} converts to {returnNum} {returnUnitString}'` con il risultato arrotondato a 5 decimali.
```js
async getUserInput => {
@@ -257,7 +257,7 @@ async getUserInput => {
};
```
All 16 unit tests are complete and passing.
Tutti i 16 test funzionali richiesti sono completi e superati.
```js
async getUserInput => {
@@ -282,7 +282,7 @@ async getUserInput => {
};
```
All 5 functional tests are complete and passing.
Tutti i 5 test funzionali richiesti sono completi e superati.
```js
async getUserInput => {

View File

@@ -1,6 +1,6 @@
---
id: 587d824a367417b2b2512c43
title: Personal Library
title: Biblioteca Personale
challengeType: 4
forumTopicId: 301571
dashedName: personal-library
@@ -8,24 +8,24 @@ dashedName: personal-library
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://personal-library.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://personal-library.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-library) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-library) 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.
- Clonare [questo repository GitHub](https://github.com/freeCodeCamp/boilerplate-project-library) e completare il tuo progetto localmente.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-library) per completare il tuo progetto.
- Usare un costruttore di siti a 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--
1. Add your MongoDB connection string to `.env` without quotes as `DB` Example: `DB=mongodb://admin:pass@1234.mlab.com:1234/fccpersonallib`
2. In your `.env` file set `NODE_ENV` to `test`, without quotes
3. You need to create all routes within `routes/api.js`
4. You will create all functional tests in `tests/2_functional-tests.js`
1. Aggiungi la stringa di connessione a MongoDB a `.env` senza virgolette come `DB` Esempio: `DB=mongodb://admin:pass@1234.mlab.com:1234/fccpersonallib`
2. Nel tuo file `.env` imposta `NODE_ENV` a `test`, senza virgolette
3. È necessario creare tutte le rotte dentro `routes/api.js`
4. Creerai tutti i test funzionali in `tests/2_functional-tests.js`
# --hints--
You can provide your own project, not the example URL.
È necessario fornire il proprio progetto, non l'URL di esempio.
```js
(getUserInput) => {
@@ -35,7 +35,7 @@ You can provide your own project, not the example URL.
};
```
You can send a <b>POST</b> request to `/api/books` with `title` as part of the form data to add a book. The returned response will be an object with the `title` and a unique `_id` as keys. If `title` is not included in the request, the returned response should be the string `missing required field title`.
Puoi inviare una richiesta <b>POST</b> a `/api/books` con `title` come parte dei dati del modulo per aggiungere un libro. La risposta restituita sarà un oggetto con un `title` e un `_id` unico come chiavi. Se `title` non è incluso nella richiesta, la risposta restituita dovrebbe essere la stringa `missing required field title`.
```js
async (getUserInput) => {
@@ -56,7 +56,7 @@ async (getUserInput) => {
};
```
You can send a <b>GET</b> request to `/api/books` and receive a JSON response representing all the books. The JSON response will be an array of objects with each object (book) containing `title`, `_id`, and `commentcount` properties.
Puoi inviare una richiesta <b>GET</b> a `/api/books` e ricevere una risposta JSON che rappresenta tutti i libri. La risposta JSON sarà un array di oggetti con ogni oggetto (libro) contenente le proprietà `title`, `_id`e `commentcount`.
```js
async (getUserInput) => {
@@ -84,7 +84,7 @@ async (getUserInput) => {
};
```
You can send a <b>GET</b> request to `/api/books/{_id}` to retrieve a single object of a book containing the properties `title`, `_id`, and a `comments` array (empty array if no comments present). If no book is found, return the string `no book exists`.
Puoi inviare una richiesta <b>GET</b> a `/api/books/{_id}` per recuperare un singolo oggetto di un libro contenente le proprietà `title`, `_id` e un array di commenti `comments` (array vuoto se nessun commento è presente). Se non viene trovato nessun libro, restituisci la stringa `no book exists`.
```js
async (getUserInput) => {
@@ -108,7 +108,7 @@ async (getUserInput) => {
};
```
You can send a <b>POST</b> request containing `comment` as the form body data to `/api/books/{_id}` to add a comment to a book. The returned response will be the books object similar to <b>GET</b> `/api/books/{_id}` request in an earlier test. If `comment` is not included in the request, return the string `missing required field comment`. If no book is found, return the string `no book exists`.
È possibile inviare una richiesta <b>POST</b> contenente `comment` come dati del corpo del modulo a `/api/books/{_id}` per aggiungere un commento a un libro. La risposta restituita sarà l'oggetto libri simile alla richiesta <b>GET</b> `/api/books/{_id}` in un test precedente. Se `comment` non è incluso nella richiesta, restituisci la stringa `missing required field comment`. Se non viene trovato nessun libro, restituisci la stringa `no book exists`.
```js
async (getUserInput) => {
@@ -146,7 +146,7 @@ async (getUserInput) => {
};
```
You can send a <b>DELETE</b> request to `/api/books/{_id}` to delete a book from the collection. The returned response will be the string `delete successful` if successful. If no book is found, return the string `no book exists`.
Puoi inviare una richiesta <b>DELETE</b> a `/api/books/{_id}` per eliminare un libro dalla collezione. La risposta restituita sarà la stringa `delete successful` se la richiesta ha avuto successo. Se non viene trovato nessun libro, restituisce la stringa `no book exists`.
```js
async (getUserInput) => {
@@ -170,7 +170,7 @@ async (getUserInput) => {
};
```
You can send a <b>DELETE</b> request to `/api/books` to delete all books in the database. The returned response will be the string `'complete delete successful` if successful.
Puoi inviare una richiesta <b>DELETE</b> a `/api/books` per eliminare tutti i libri nel database. La risposta restituita sarà la stringa `'complete delete successful` se la richiesta ha avuto successo.
```js
async (getUserInput) => {
@@ -187,7 +187,7 @@ async (getUserInput) => {
};
```
All 10 functional tests required are complete and passing.
Tutti i 10 test funzionali richiesti sono completi e superati.
```js
async (getUserInput) => {

View File

@@ -1,6 +1,6 @@
---
id: 5e601bf95ac9d0ecd8b94afd
title: Sudoku Solver
title: Risolutore di sudoku
challengeType: 4
forumTopicId: 462357
dashedName: sudoku-solver
@@ -8,60 +8,60 @@ dashedName: sudoku-solver
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://sudoku-solver.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://sudoku-solver.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-sudoku-solver) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-sudoku-solver) 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.
- Clonare [questo repository GitHub](https://github.com/freecodecamp/boilerplate-project-sudoku-solver) e completare il tuo progetto localmente.
- Usare [la nostra bozza di progetto su Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-sudoku-solver) per completare il tuo progetto.
- Usare un costruttore di siti a 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 puzzle logic can go into `/controllers/sudoku-solver.js`
- The `validate` function should take a given puzzle string and check it to see if it has 81 valid characters for the input.
- The `check` functions should be validating against the *current* state of the board.
- The `solve` function should handle solving any given valid puzzle string, not just the test inputs and solutions. You are expected to write out the logic to solve this.
- All routing logic can go into `/routes/api.js`
- See the `puzzle-strings.js` file in `/controllers` for some sample puzzles your application should solve
- To run the challenge tests on this page, 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 puzzle può andare in `/controllers/sudoku-solver.js`
- La funzione `validate` dovrebbe prendere una data stringa rompicapo e controllarla per vedere se ha 81 caratteri validi per l'ingresso.
- Le funzioni `check` dovrebbero convalidare un posizionamento rispetto allo stato *corrente* della scheda.
- La funzione `solve` dovrebbe gestire la risoluzione di qualsiasi stringa di puzzle valida, non solo gli input e le soluzioni di test. Ci si aspetta che sia tu a scrivere la logica per risolvere questo problema.
- Tutta la logica di routing può entrare in `/routes/api.js`
- Vedi il file `puzzle-strings.js` in `/controllers` per alcuni puzzle di esempio che la tua applicazione dovrebbe risolvere
- Per eseguire i test su questa pagina, 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`:
- Logic handles a valid puzzle string of 81 characters
- Logic handles a puzzle string with invalid characters (not 1-9 or `.`)
- Logic handles a puzzle string that is not 81 characters in length
- Logic handles a valid row placement
- Logic handles an invalid row placement
- Logic handles a valid column placement
- Logic handles an invalid column placement
- Logic handles a valid region (3x3 grid) placement
- Logic handles an invalid region (3x3 grid) placement
- Valid puzzle strings pass the solver
- Invalid puzzle strings fail the solver
- Solver returns the expected solution for an incomplete puzzle
- La logica gestisce una stringa rompicapo valida di 81 caratteri
- La logica gestisce una stringa rompicapo con caratteri non validi (non 1-9 o `.`)
- La logica gestisce una stringa rompicapo che non è di 81 caratteri di lunghezza
- La logica gestisce un posizionamento di riga valido
- La logica gestisce un posizionamento di riga non valido
- La logica gestisce un posizionamento di colonna valido
- La logica gestisce un posizionamento di colonna non valido
- La logica gestisce un posizionamento di regione (griglia 3x3) valido
- La logica gestisce un posizionamento di regione (griglia 3x3) non valido
- Le stringhe rompicapo valide passano il risolutore
- Le stringhe rompicapo non valide vengono rifiutate dal risolutore
- Il risolutore restituisce la soluzione prevista per un puzzle incompleto
Write the following tests in `tests/2_functional-tests.js`
Scrivi i seguenti test in `tests/2_functional-tests.js`
- Solve a puzzle with valid puzzle string: POST request to `/api/solve`
- Solve a puzzle with missing puzzle string: POST request to `/api/solve`
- Solve a puzzle with invalid characters: POST request to `/api/solve`
- Solve a puzzle with incorrect length: POST request to `/api/solve`
- Solve a puzzle that cannot be solved: POST request to `/api/solve`
- Check a puzzle placement with all fields: POST request to `/api/check`
- Check a puzzle placement with single placement conflict: POST request to `/api/check`
- Check a puzzle placement with multiple placement conflicts: POST request to `/api/check`
- Check a puzzle placement with all placement conflicts: POST request to `/api/check`
- Check a puzzle placement with missing required fields: POST request to `/api/check`
- Check a puzzle placement with invalid characters: POST request to `/api/check`
- Check a puzzle placement with incorrect length: POST request to `/api/check`
- Check a puzzle placement with invalid placement coordinate: POST request to `/api/check`
- Check a puzzle placement with invalid placement value: POST request to `/api/check`
- Risolvi un puzzle con stringa rompicapo valida: richiesta POST a `/api/solve`
- Risolvi un puzzle con stringa rompicapo mancante: richiesta POST a `/api/solve`
- Risolvi un puzzle con stringa rompicapo non valida: richiesta POST a `/api/solve`
- Risolvi un puzzle di lunghezza sbagliata: richiesta POST a `/api/solve`
- Risolvi un puzzle che non può essere risolto: richiesta POST a `/api/solve`
- Controlla un posizionamento del puzzle con tutti i campi: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle con un singolo conflitto di posizionamento: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle con conflitti multipli di posizionamento: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle con tutti i conflitti di posizionamento: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle con i campi richiesti mancanti: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle con caratteri non validi: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle di lunghezza sbagliata: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle con coordinate non valide: richiesta POST a `/api/check`
- Controlla un posizionamento del puzzle di valore non valido: richiesta POST a `/api/check`
# --hints--
You should provide your own project, not the example URL.
È necessario fornire il proprio progetto, non l'URL di esempio.
```js
(getUserInput) => {
@@ -70,7 +70,7 @@ You should provide your own project, not the example URL.
};
```
You can `POST` `/api/solve` with form data containing `puzzle` which will be a string containing a combination of numbers (1-9) and periods `.` to represent empty spaces. The returned object will contain a `solution` property with the solved puzzle.
È possibile fare una richiesta `POST` a `/api/solve` con i dati del modulo contenente `puzzle` che sarà una stringa contenente una combinazione di numeri (1-9) e punti `.` per rappresentare spazi vuoti. L'oggetto restituito conterrà una proprietà `solution` con il puzzle risolto.
```js
async (getUserInput) => {
@@ -89,7 +89,7 @@ async (getUserInput) => {
};
```
If the object submitted to `/api/solve` is missing `puzzle`, the returned value will be `{ error: 'Required field missing' }`
Se l'oggetto sottoposto a `/api/solve` non ha il `puzzle`, il valore restituito sarà `{ error: 'Required field missing' }`
```js
async (getUserInput) => {
@@ -107,7 +107,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/solve` contains values which are not numbers or periods, the returned value will be `{ error: 'Invalid characters in puzzle' }`
Se il rompicapo sottoposto a `/api/solve` contiene valori che non sono numeri o punti, il valore restituito sarà `{ error: 'Invalid characters in puzzle' }`
```js
async (getUserInput) => {
@@ -125,7 +125,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/solve` is greater or less than 81 characters, the returned value will be `{ error: 'Expected puzzle to be 81 characters long' }`
Se il rompicapo sottoposto a `/api/solve` ha lunghezza maggiore o minore di 81 caratteri, il valore restituito sarà `{ error: 'Expected puzzle to be 81 characters long' }`
```js
async (getUserInput) => {
@@ -143,7 +143,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/solve` is invalid or cannot be solved, the returned value will be `{ error: 'Puzzle cannot be solved' }`
Se il puzzle sottoposto a `/api/solve` non è valido o non può essere risolto, il valore restituito sarà `{ error: 'Puzzle cannot be solved' }`
```js
async (getUserInput) => {
@@ -161,7 +161,7 @@ async (getUserInput) => {
};
```
You can `POST` to `/api/check` an object containing `puzzle`, `coordinate`, and `value` where the `coordinate` is the letter A-I indicating the row, followed by a number 1-9 indicating the column, and `value` is a number from 1-9.
Puoi fare una richiesta `POST` a `/api/check` con un oggetto contenente `puzzle`, `coordinate`, e `value` dove la coordinata `coordinate` è la lettera A-I che indica la riga, seguita da un numero 1-9 che indica la colonna, e `value` è un numero compreso tra 1 e 9.
```js
async (getUserInput) => {
@@ -180,7 +180,7 @@ async (getUserInput) => {
};
```
The return value from the `POST` to `/api/check` will be an object containing a `valid` property, which is `true` if the number may be placed at the provided coordinate and `false` if the number may not. If false, the returned object will also contain a `conflict` property which is an array containing the strings `"row"`, `"column"`, and/or `"region"` depending on which makes the placement invalid.
Il valore di ritorno della richiesta `POST` a `/api/check` sarà un oggetto contenente una proprietà `valid`, che sarà `true` se il numero può essere posto alla coordinata fornita e `false` se non può. Se falso, l'oggetto restituito conterrà anche una proprietà `conflict` che è un array contenente le stringhe `"row"`, `"column"`, e/o `"region"` a seconda di quale rende il posizionamento non valido.
```js
async (getUserInput) => {
@@ -203,7 +203,7 @@ async (getUserInput) => {
};
```
If `value` submitted to `/api/check` is already placed in `puzzle` on that `coordinate`, the returned value will be an object containing a `valid` property with `true` if `value` is not conflicting.
Se il valore `value` sottoposto a `/api/check` è già posizionato sul `puzzle` a quella `coordinate`, il valore restituito sarà un oggetto contenente una proprietà `valid` con `true` se `value` non dà conflitto.
```js
async (getUserInput) => {
@@ -222,7 +222,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/check` contains values which are not numbers or periods, the returned value will be `{ error: 'Invalid characters in puzzle' }`
Se il puzzle sottoposto a `/api/check` contiene valori che non sono numeri o punti, il valore restituito sarà `{ error: 'Invalid characters in puzzle' }`
```js
async (getUserInput) => {
@@ -242,7 +242,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/check` is greater or less than 81 characters, the returned value will be `{ error: 'Expected puzzle to be 81 characters long' }`
Se il rompicapo sottoposto a `/api/check` ha lunghezza maggiore o minore di 81 caratteri, il valore restituito sarà `{ error: 'Expected puzzle to be 81 characters long' }`
```js
async (getUserInput) => {
@@ -262,7 +262,7 @@ async (getUserInput) => {
};
```
If the object submitted to `/api/check` is missing `puzzle`, `coordinate` or `value`, the returned value will be `{ error: Required field(s) missing }`
Se all'oggetto sottoposto a `/api/check` manca `puzzle`, `coordinate` o `value`, il valore restituito sarà `{ error: Required field(s) missing }`
```js
async (getUserInput) => {
@@ -280,7 +280,7 @@ async (getUserInput) => {
};
```
If the coordinate submitted to `api/check` does not point to an existing grid cell, the returned value will be `{ error: 'Invalid coordinate'}`
Se la coordinata inviata a `api/check` non punta a una cella della griglia esistente, il valore restituito sarà `{ error: 'Invalid coordinate'}`
```js
async (getUserInput) => {
@@ -300,7 +300,7 @@ async (getUserInput) => {
};
```
If the `value` submitted to `/api/check` is not a number between 1 and 9, the returned values will be `{ error: 'Invalid value' }`
Se il valore `value` inviato a `/api/check` non è un numero compreso tra 1 e 9, i valori restituiti saranno `{ error: 'Invalid value' }`
```js
async (getUserInput) => {
@@ -320,7 +320,7 @@ async (getUserInput) => {
};
```
All 12 unit tests are complete and passing. See `/tests/1_unit-tests.js` for the expected behavior you should write tests for.
Tutti i 12 test funzionali richiesti sono completi e superati. Vedi `/tests/1_unit-tests.js` per il comportamento previsto per il quale dovresti scrivere dei test.
```js
async (getUserInput) => {
@@ -343,7 +343,7 @@ async (getUserInput) => {
};
```
All 14 functional tests are complete and passing. See `/tests/2_functional-tests.js` for the functionality you should write tests for.
Tutti i 14 test funzionali richiesti sono completi e superati. Vedi `/tests/2_functional-tests.js` per le funzionalità per le quali dovresti scrivere dei test.
```js
async (getUserInput) => {