Skip to content

Commit 5f9ac18

Browse files
author
angelochiello
committed
Translated till "Testing" (included)
1 parent 72cfa05 commit 5f9ac18

File tree

1 file changed

+46
-45
lines changed

1 file changed

+46
-45
lines changed

i18n/it-IT.md

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,10 +2078,11 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
20782078
20792079
## Logica di Startup
20802080
2081-
### Configuration
2082-
- Inject code into [module configuration](https://docs.angularjs.org/guide/module#module-loading-dependencies) that must be configured before running the angular app. Ideal candidaes include providers and constants.
2081+
### Configurazione
2082+
2083+
- Inietta codice nel [modulo di configurazione](https://docs.angularjs.org/guide/module#module-loading-dependencies) che deve essere configurato prima dell'esecuzione dell'app angular. I candidati ideali includono provider e costanti.
20832084
2084-
*Why?:* This makes it easier to have a less places for configuration.
2085+
*Perché?:* Questo rende più facile ottenere pochi posti atti alla configurazione
20852086
20862087
```javascript
20872088
angular
@@ -2108,11 +2109,11 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
21082109
}
21092110
```
21102111
2111-
### Run Blocks
2112+
### Blocchi Run
21122113
2113-
- Any code that needs to run when an application starts should be declared in a factory, exposed via a function, and injected into the [run block](https://docs.angularjs.org/guide/module#module-loading-dependencies).
2114+
- Qualunche codice che necessiti di essere eseguito quando un'applicazione si avvia dovrebbe essere dichiarato in una factory, esposto tramite funzione ed iniettato nel [blocco run](https://docs.angularjs.org/guide/module#module-loading-dependencies).
21142115
2115-
*Perché?*: Code directly in a run block can be difficult to test. Placing in a factory makes it easier to abstract and mock.
2116+
*Perché?*: Codice posto direttamente in un blocco run può essere difficile da testate. Metterlo in una factory lo rende più astratto e simulabile (farne un mock).
21162117
21172118
```javascript
21182119
angular
@@ -2131,102 +2132,102 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
21312132
21322133
## Wrapper dei Servizi $ di Angular
21332134
2134-
### $document and $window
2135+
### $document e $window
21352136
2136-
- Use [`$document`](https://docs.angularjs.org/api/ng/service/$document) and [`$window`](https://docs.angularjs.org/api/ng/service/$window) instead of `document` and `window`.
2137+
- Usa [`$document`](https://docs.angularjs.org/api/ng/service/$document) e [`$window`](https://docs.angularjs.org/api/ng/service/$window) al posto di `document` e `window`.
21372138
2138-
*Perché?*: These services are wrapped by Angular and more easily testable than using document and window in tests. This helps you avoid having to mock document and window yourself.
2139+
*Perché?*: Questi servizi sono gestiti da Angular e più facilmente testabili che l'uso di document e window nei test. Ciò ti aiuta ad evitare di fare mock di document e window.
21392140
2140-
### $timeout and $interval
2141+
### $timeout e $interval
21412142
2142-
- Use [`$timeout`](https://docs.angularjs.org/api/ng/service/$timeout) and [`$interval`](https://docs.angularjs.org/api/ng/service/$interval) instead of `setTimeout` and `setInterval` .
2143+
- Usa [`$timeout`](https://docs.angularjs.org/api/ng/service/$timeout) e [`$interval`](https://docs.angularjs.org/api/ng/service/$interval) al posto di `setTimeout` e `setInterval` .
21432144
2144-
*Perché?*: These services are wrapped by Angular and more easily testable and handle AngularJS's digest cycle thus keeping data binding in sync.
2145+
*Perché?*: Questi servizi sono gestiti da Angular e più facilmente testabili e trattano il ciclo di digest di AngularJS quindi tengono il data binding sincronizzato.
21452146
21462147
**[Torna all'inizio](#table-of-contents)**
21472148
21482149
## Test
2149-
Unit testing helps maintain clean code, as such I included some of my recommendations for unit testing foundations with links for more information.
2150+
Gli unit test aiutano a mantenere il codice più chiaro, perciò ho incluso alcune mie raccomandazioni fondamentali per lo unit testing con link e uteriori informazioni.
21502151
2151-
### Write Tests with Stories
2152+
### Scrivi i test con le Storie
21522153
2153-
- Write a set of tests for every story. Start with an empty test and fill them in as you write the code for the story.
2154+
- Scrivi un set di test per ogni storia. Inizia con un test vuoto e riempilo fino a scrivere il codice per la storia.
21542155
2155-
*Perché?*: Writing the test descriptions helps clearly define what your story will do, will not do, and how you can measure success.
2156+
*Perché?*: Scrivere la descrizione del test aiuta a definire chiaramente cosa la tua stoia farà, non farà e come puoi misurarne il successo.
21562157
21572158
```javascript
2158-
it('should have Avengers controller', function() {
2159+
it('dovrebbe avere il controller Avenger', function() {
21592160
//TODO
21602161
});
21612162

2162-
it('should find 1 Avenger when filtered by name', function() {
2163+
it('dovrebbe trovare 1 Avenger quando filtrato per nome', function() {
21632164
//TODO
21642165
});
21652166

2166-
it('should have 10 Avengers', function() {}
2167-
//TODO (mock data?)
2167+
it('dovrebbe avere 10 Avenger', function() {}
2168+
//TODO (fare un mock dei dati?)
21682169
});
21692170

2170-
it('should return Avengers via XHR', function() {}
2171+
it('dovrebbe ritornare Avenger via XHR', function() {}
21712172
//TODO ($httpBackend?)
21722173
});
21732174

2174-
// and so on
2175+
// continuare
21752176
```
21762177
21772178
### Testing Library
21782179
2179-
- Use [Jasmine](http://jasmine.github.io/) or [Mocha](http://visionmedia.github.io/mocha/) for unit testing.
2180+
- Usa [Jasmine](http://jasmine.github.io/) oppure [Mocha](http://visionmedia.github.io/mocha/) per lo unit testing.
21802181
2181-
*Perché?*: Both Jasmine and Mocha are widely used in the AngularJS community. Both are stable, well maintained, and provide robust testing features.
2182+
*Perché?*: Sia Jasmine che Mocha sono largamente utilizzati nella comunità di AngularJS. Entrambi son stabili, ben manutenut e forniscono funzinalità solide per i test.
21822183
2183-
Nota: When using Mocha, also consider choosing an assert library such as [Chai](http://chaijs.com).
2184+
Nota: Usando Mocha, tieni in considerazione di usare anche una libreria di asserzione come [Chai](http://chaijs.com).
21842185
2185-
### Test Runner
2186+
### Esecutori di Test
21862187
2187-
- Use [Karma](http://karma-runner.github.io) as a test runner.
2188+
- Usa [Karma](http://karma-runner.github.io) come esecutore di test.
21882189
2189-
*Perché?*: Karma is easy to configure to run once or automatically when you change your code.
2190+
*Perché?*: Karma è facilmente configurabile per essere eseguito una sola volta o automaticamante quando cambia il tuo codice.
21902191
2191-
*Perché?*: Karma hooks into your Continuous Integration process easily on its own or through Grunt or Gulp.
2192+
*Perché?*: Karma si aggangia facilmente al tuo processo di Integrazione Continua da solo o attraverso Grunt o Gulp.
21922193
2193-
*Perché?*: Some IDE's are beginning to integrate with Karma, such as [WebStorm](http://www.jetbrains.com/webstorm/) and [Visual Studio](http://visualstudiogallery.msdn.microsoft.com/02f47876-0e7a-4f6c-93f8-1af5d5189225).
2194+
*Perché?*: Alcuni IDE cominciamo ad integrare Karma, come [WebStorm](http://www.jetbrains.com/webstorm/) e [Visual Studio](http://visualstudiogallery.msdn.microsoft.com/02f47876-0e7a-4f6c-93f8-1af5d5189225).
21942195
2195-
*Perché?*: Karma works well with task automation leaders such as [Grunt](http://www.gruntjs.com) (with [grunt-karma](https://github.com/karma-runner/grunt-karma)) and [Gulp](http://www.gulpjs.com) (with [gulp-karma](https://github.com/lazd/gulp-karma)).
2196+
*Perché?*: Karma lavora bene con leader di automazione di processo quali [Grunt](http://www.gruntjs.com) (con [grunt-karma](https://github.com/karma-runner/grunt-karma)) e [Gulp](http://www.gulpjs.com) (con [gulp-karma](https://github.com/lazd/gulp-karma)).
21962197
2197-
### Stubbing and Spying
2198+
### Stubbing e Spying
21982199
2199-
- Use Sinon for stubbing and spying.
2200+
- Usa Sinon per lo stubbing e spying.
22002201
2201-
*Perché?*: Sinon works well with both Jasmine and Mocha and extends the stubbing and spying features they offer.
2202+
*Perché?*: Sinon lavora bene sia con Jasmine che Mocha ed estende le funzionalità di stubbing e spying che questi offrono.
22022203
2203-
*Perché?*: Sinon makes it easier to toggle between Jasmine and Mocha, if you want to try both.
2204+
*Perché?*: Sinon rende pià semplice il passagio tra Jasmine e Mocha, nel caso voglia usarli entrambi.
22042205
22052206
### Headless Browser
22062207
2207-
- Use [PhantomJS](http://phantomjs.org/) to run your tests on a server.
2208+
- Usa [PhantomJS](http://phantomjs.org/) per eseguire i test su un server.
22082209
2209-
*Perché?*: PhantomJS is a headless browser that helps run your tests without needing a "visual" browser. So you do not have to install Chrome, Safari, IE, or other browsers on your server.
2210+
*Perché?*: PhantomJS è un headless browser che aiuta l'esecuzione di test senza la necessità di un browser "visuale". Quindi non devi installare Chrome, Safari, IE o altri browser sul server.
22102211
2211-
Nota: You should still test on all browsers in your environment, as appropriate for your target audience.
2212+
Nota: Dovresti in ogni caso testare tutti i browser del tuo ambiente, come appropriato per il pubblico che è il target.
22122213
2213-
### Code Analysis
2214+
### Analisi del codice
22142215
2215-
- Run JSHint on your tests.
2216+
- Esegui JSHint sui tuoi test.
22162217
2217-
*Perché?*: Tests are code. JSHint can help identify code quality issues that may cause the test to work improperly.
2218+
*Perché?*: I test sono codice. JSHint può aiutare ad identificare problemi di qualità del cosice che causano il'improprio funzionamento del test.
22182219
2219-
### Alleviate Globals for JSHint Rules on Tests
2220+
### Alleviare le regole sulle variabili globali di JSHint per i Test
22202221
2221-
- Relax the rules on your test code to allow for common globals such as `describe` and `expect`.
2222+
- Rilassa le regole sul codice dei test per consentendoli per variabili globali comuni quali `describe` ed `expect`.
22222223
2223-
*Perché?*: Your tests are code and require the same attention and code quality rules as all of your production code. However, global variables used by the testing framework, for example, can be relaxed by including this in your test specs.
2224+
*Perché?*: I tuoi test sono codice e richiedono al medesima attenzione e regole per la qualità del codice come tutto il resto del codice di produzione. Comunque, variabili globali usate dai framework di test, per esempio, possono essere rilassate includendole nelle specifiche dei test.
22242225
22252226
```javascript
22262227
/* global sinon, describe, it, afterEach, beforeEach, expect, inject */
22272228
```
22282229
2229-
![Testing Tools](https://raw.githubusercontent.com/johnpapa/angularjs-styleguide/master/assets/testing-tools.png)
2230+
![Strumenti per i test](https://raw.githubusercontent.com/johnpapa/angularjs-styleguide/master/assets/testing-tools.png)
22302231
22312232
**[Torna all'inizio](#table-of-contents)**
22322233

0 commit comments

Comments
 (0)