I am using Jhipster and have created a gateway application with front end. I have made a pipline on github which s trying to run front end tests i.e. npm run test However the tests are failing with over 200 errors in tyescript. Mostly the same error as seen below.
I know I can go though each file and try correct all errors but I am wondering why/how jhipster created all invalid ts files. Is it possibly a versioning issue as I did do a jhipster upgrade but I am not sure if these tests were passing before as pipeline is only new and i never ran locally.
For reference i am using latest jHipster 6.6.0 and have latest node LTS release installed 12.4.1 and npm 6.13.6. However in Jhipster generated pom it pulls dependency for node 12.13.1 and npm 6.13.4.
Over 260 of these errors and some other
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
Also I had to edit numerous ts files to fix broken module imports to get the webpack build to complete before getting this far. Again just wondering how jHipster is generating files with such errors.
Update - I got all passing by configuring tslint to ignore these error. However I'm not sure why the Jhipster generated files are containing errors out of box. Now "npm run webpack:prod" failing with hundreds of errors such as below
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"
}
}
.yo-rc.jsonto this question so it's possible to recreate your app? I just created a gateway with all the defaults and rannpm testwithout issues. Test Suites: 25 passed, 25 total Tests: 106 passed, 106 total Snapshots: 0 total Time: 20.818s Ran all test suites. Execution time: 29 s. - Matt Raible