I use this project to test different concepts of unit testing the Angular applications. BTW, you can find decent unit testing styleguide for Angular in corresponding repository nearby.
This project was generated with Angular CLI. Please refer to the documentation to learn about its main commands and features.
=> Angular Project Code Coverage:
-> Download Project angular version and setup in environment variable
-> sonar-project.properties (In Project Root folder)
sonar.projectKey=Angular_Project sonar.projectName=Angular_Project sonar.projectVersion=1.0 sonar.sources=src
sonar.sourceEncoding=UTF-8 sonar.exclusions= /node_modules//*
sonar.typescript.lcov.reportPaths=coverage/lcov.info sonar.javascript.lcov.reportPaths=coverage/lcov.info
-> package.json
"test": "ng test --code-coverage",
-> angular.json
"test": "codeCoverage": true,
Command:
- npm install
- npm run test
- sonar-scanner.bat
