gpt4 book ai didi

angular - 原理图 "spec": false not working on Ionic 4 app

转载 作者:行者123 更新时间:2023-12-03 21:19:57 26 4
gpt4 key购买 nike

如何停止生成 .spec文件在 Ionic 4应用程序?

我试过这个:但它不起作用。即它仍然生成 .spec文件。

ionic g service services/MyService

angular.json
  "schematics": {
"@ionic/angular-toolkit:component": {
"styleext": "scss"
},
"@ionic/angular-toolkit:page": {
"styleext": "scss"
},
"@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
}
}
}

最佳答案

这里发生的是 Angular 集的默认 ionic 样板 defaultCollection@ionic/angular-toolkit :

angular.json

"cli": {
"defaultCollection": "@ionic/angular-toolkit"
},

所以你必须为 @ionic/angular-toolkit 提供这些标志具体选项如:
"@ionic/angular-toolkit:service": {
"spec": false, // or "skipTests": true
}

关于angular - 原理图 "spec": false not working on Ionic 4 app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55314136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com