nella versione precedente, spec.ts può disabilitare con .angular-cli.json come sotto. c'è un modo per farlo con angular.json nella versione 6.0.0.
"defaults": {
"component": {
"spec": false
},
"service": {
"spec": false
},
...
}
risposte:
3 per risposta № 1nella versione "6.0.0" * .spec.ts può essere disabilitato con angular.json
"schematics": {
"@schematics/angular:component": {
"prefix": "fmyp",
"styleext": "css",
"spec": false
},
"@schematics/angular:directive": {
"prefix": "fmp",
"spec": false
},
"@schematics/angular:module": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
},
"@schematics/angular:pipe": {
"spec": false
},
"@schematics/angular:class": {
"spec": false
}
}
1 per risposta № 2
Metodo 1:
Puoi anche disabilitare la generazione delle specifiche al momento della creazione delle cose usando Angular-cli aggiungendo "--no-spec"
ng generate component my-component --no-spec
Metodo 2: Disattiva permanentemente nel file angular.json. Puoi modificare gli schemi per il tuo progetto.
"schematics": {
"@schematics/angular:component": {
"styleext": "scss",
"spec": false
},
"@schematics/angular:class": {
"spec": false
},
"@schematics/angular:directive": {
"spec": false
},
"@schematics/angular:guard": {
"spec": false
},
"@schematics/angular:module": {
"spec": false
},
"@schematics/angular:pipe": {
"spec": false
},
"@schematics/angular:service": {
"spec": false
}
},