我正在使用Jhipster,并且已经创建了带有前端的网关应用程序。我在github上做了一条尝试运行前端测试的管道,即npm run test但是,测试失败,打字稿中出现200多个错误。大致相同的错误,如下所示。
我知道我可以遍历每个文件并尝试纠正所有错误,但是我想知道jhipster为什么/如何创建了所有无效的ts文件。如我进行的Jhipster升级那样,可能是版本问题,但我不确定这些测试是否之前通过,因为管道只是新的,而且我从未在本地运行过。
作为参考,我正在使用最新的jHipster 6.6.0,并已安装最新的节点LTS版本12.4.1和npm 6.13.6。但是,在Jhipster生成的pom中,它拉动了对节点12.13.1和npm 6.13.4的依赖性。
这些错误中有260多个和其他
error expected call-signature: 'countDeleteButtons' to have a typedef (tslint:typedef) @typescript-eslint/tslint/config
error Async arrow function has no 'await' expression @typescript-eslint/require-await
此外,我还必须编辑大量的ts文件以修复损坏的模块导入,以使webpack的构建在此之前完成。再次只是想知道jHipster如何生成带有此类错误的文件。
Update-通过配置tslint忽略这些错误,我获得了所有通过。但是我不确定为什么Jhipster生成的文件中包含开箱即用的错误。现在,“ npm run webpack:prod”失败,并出现数百个错误,例如以下]
src/test/javascript/spec/app/entities/jawnapp/comment/comment.service.spec.ts:18:9 - error TS7034: Variable 'expectedResult' implicitly has type 'any' in some locations where its type cannot be determined. src/test/javascript/spec/app/entities/jawnapp/comment/comment.service.spec.ts:48:16 - error TS7005: Variable 'expectedResult' implicitly has an 'any' type.
。yo-rc.json
{
"generator-jhipster": {
"promptValues": {
"packageName": "com.jawndoe.gate",
"microservicePath": "../jawnapp"
},
"jhipsterVersion": "6.6.0",
"applicationType": "gateway",
"baseName": "jawngate",
"packageName": "com.jawndoe.gate",
"packageFolder": "com/jawndoe/gate",
"serverPort": "8080",
"authenticationType": "oauth2",
"cacheProvider": "hazelcast",
"enableHibernateCache": true,
"websocket": "spring-websocket",
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"searchEngine": "elasticsearch",
"messageBroker": "kafka",
"serviceDiscoveryType": "eureka",
"buildTool": "maven",
"enableSwaggerCodegen": true,
"useSass": true,
"clientPackageManager": "npm",
"clientFramework": "angularX",
"clientTheme": "lux",
"clientThemeVariant": "dark",
"testFrameworks": ["gatling", "cucumber", "protractor"],
"jhiPrefix": "gate",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": false,
"blueprints": [],
"embeddableLaunchScript": false,
"creationTimestamp": 1579646926343,
"herokuAppName": "jawngate",
"herokuDeployType": "jar"
}
}
我正在使用Jhipster,并且已经创建了带有前端的网关应用程序。我在github上做了一条尝试运行前端测试的提示,即npm run test但是测试失败了...
如果我将.yo-rc.json
复制并粘贴到一个空目录中并运行jhipster
(版本6.6.0),则一切似乎正常。 npm test
的结果: