diff --git a/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java b/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java index 4183a93bc85..58f02bb346b 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java @@ -113,7 +113,7 @@ public JHipsterModule buildVueModule(JHipsterModuleProperties properties) { .add(SOURCE.template("Dummy.spec.ts"), to("src/test/webapp/unit/Dummy.spec.ts")) .add(APP_SOURCE.template("test/webapp/unit/shared/http/infrastructure/secondary/AxiosHttp.spec.ts.mustache"), TEST_DESTINATION.append("unit/shared/http/infrastructure/secondary/AxiosHttp.spec.ts")) .add(APP_SOURCE.template("test/webapp/unit/shared/http/infrastructure/secondary/AxiosStub.ts.mustache"), TEST_DESTINATION.append("unit/shared/http/infrastructure/secondary/AxiosStub.ts")) - .add(APP_SOURCE.template("test/webapp/unit/router/HomeRouter.spec.ts.mustache"), TEST_DESTINATION.append("unit/router/HomeRouter.spec.ts")) + .add(APP_SOURCE.template("test/webapp/unit/router/infrastructure/primary/HomeRouter.spec.ts.mustache"), TEST_DESTINATION.append("unit/router/infrastructure/primary/HomeRouter.spec.ts")) .and() .build(); //@formatter:on diff --git a/src/main/resources/generator/client/vue/vitest.config.ts.mustache b/src/main/resources/generator/client/vue/vitest.config.ts.mustache index 6062abddd0c..4f92410710d 100644 --- a/src/main/resources/generator/client/vue/vitest.config.ts.mustache +++ b/src/main/resources/generator/client/vue/vitest.config.ts.mustache @@ -27,11 +27,24 @@ export default defineConfig({ exclude: [ ...configDefaults.coverage.exclude as string[], 'src/main/webapp/app/main.ts', + 'src/main/webapp/app/injections.ts', + 'src/main/webapp/app/router.ts', 'src/main/webapp/**/*.component.ts', ], provider: 'istanbul', reportsDirectory: '{{projectBuildDirectory}}/test-results/', - reporter: ['html', 'json-summary', 'text', 'text-summary', 'lcov', 'clover'] + reporter: ['html', 'json-summary', 'text', 'text-summary', 'lcov', 'clover'], + thresholds: { + perFile: true, + autoUpdate: true, + 100: true, + }, + watermarks: { + statements: [100, 100], + branches: [100, 100], + functions: [100, 100], + lines: [100, 100], + }, }, }, }); diff --git a/src/main/resources/generator/client/vue/webapp/app/test/webapp/unit/router/HomeRouter.spec.ts.mustache b/src/main/resources/generator/client/vue/webapp/app/test/webapp/unit/router/infrastructure/primary/HomeRouter.spec.ts.mustache similarity index 100% rename from src/main/resources/generator/client/vue/webapp/app/test/webapp/unit/router/HomeRouter.spec.ts.mustache rename to src/main/resources/generator/client/vue/webapp/app/test/webapp/unit/router/infrastructure/primary/HomeRouter.spec.ts.mustache diff --git a/src/main/resources/generator/server/sonar/sonar-fullstack-project.properties.mustache b/src/main/resources/generator/server/sonar/sonar-fullstack-project.properties.mustache index 19fefbb56a7..803641c2de5 100644 --- a/src/main/resources/generator/server/sonar/sonar-fullstack-project.properties.mustache +++ b/src/main/resources/generator/server/sonar/sonar-fullstack-project.properties.mustache @@ -17,7 +17,13 @@ sonar.testExecutionReportPaths={{projectBuildDirectory}}/test-results/TESTS-resu sonar.javascript.lcov.reportPaths={{projectBuildDirectory}}/test-results/lcov.info sonar.sourceEncoding=UTF-8 -sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, {{projectBuildDirectory}}/classes/static/**/*.*, src/main/webapp/app/index.tsx +sonar.exclusions=\ + src/main/webapp/app/home/infrastructure/primary/*.*,\ + src/main/webapp/app/*.ts,\ + src/main/webapp/content/**/*.*,\ + {{projectBuildDirectory}}/classes/static/**/*.*,\ + src/main/webapp/app/index.tsx,\ + src/main/webapp/main.ts sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6437,S6564,UndocumentedApi diff --git a/src/main/resources/generator/server/sonar/sonar-project.properties.mustache b/src/main/resources/generator/server/sonar/sonar-project.properties.mustache index 2e78d59b9a6..9dcdc64e640 100644 --- a/src/main/resources/generator/server/sonar/sonar-project.properties.mustache +++ b/src/main/resources/generator/server/sonar/sonar-project.properties.mustache @@ -14,7 +14,12 @@ sonar.java.codeCoveragePlugin=jacoco sonar.junit.reportPaths={{projectBuildDirectory}}/surefire-reports,{{projectBuildDirectory}}/failsafe-reports sonar.sourceEncoding=UTF-8 -sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, {{projectBuildDirectory}}/classes/static/**/*.*, src/main/webapp/app/index.tsx +sonar.exclusions=\ + src/main/webapp/app/*.ts,\ + src/main/webapp/content/**/*.*,\ + {{projectBuildDirectory}}/classes/static/**/*.*,\ + src/main/webapp/app/index.tsx,\ + src/main/webapp/main.ts sonar.issue.ignore.multicriteria=S117,S119,S125,S3437,S4502,S4684,S4032,S5778,S1133,S6206,S6548,S6437,S6471,UndocumentedApi diff --git a/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java index 30b4a5a0738..9b45fda3ecc 100644 --- a/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java @@ -84,7 +84,7 @@ void shouldCreateVueModule() { .hasFiles("src/test/webapp/unit/Dummy.spec.ts") .hasFiles("src/test/webapp/unit/shared/http/infrastructure/secondary/AxiosHttp.spec.ts") .hasFiles("src/test/webapp/unit/shared/http/infrastructure/secondary/AxiosStub.ts") - .hasFiles("src/test/webapp/unit/router/HomeRouter.spec.ts"); + .hasFiles("src/test/webapp/unit/router/infrastructure/primary/HomeRouter.spec.ts"); //@formatter:on } diff --git a/src/test/java/tech/jhipster/lite/generator/server/sonarqube/domain/SonarQubeModulesFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/sonarqube/domain/SonarQubeModulesFactoryTest.java index 409bcbba3e9..b7967b2aed9 100644 --- a/src/test/java/tech/jhipster/lite/generator/server/sonarqube/domain/SonarQubeModulesFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/server/sonarqube/domain/SonarQubeModulesFactoryTest.java @@ -40,9 +40,7 @@ void shouldBuildBackendModule() { .hasFile("sonar-project.properties") .containing("sonar.coverage.jacoco.xmlReportPaths=target/jacoco/jacoco.xml") .containing("sonar.junit.reportPaths=target/surefire-reports,target/failsafe-reports") - .containing( - "sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, target/classes/static/**/*.*, src/main/webapp/app/index.tsx" - ) + .containing("sonar.exclusions=\\") .notContaining("sonar.testExecutionReportPaths=target/test-results/TESTS-results-sonar.xml"); } @@ -54,9 +52,7 @@ void shouldBuildBackendFrontendModule() { assertCommonModule(module) .hasFile("sonar-project.properties") - .containing( - "sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, target/classes/static/**/*.*, src/main/webapp/app/index.tsx" - ) + .containing("sonar.exclusions=\\") .containing("sonar.testExecutionReportPaths=target/test-results/TESTS-results-sonar.xml") .containing("sonar.javascript.lcov.reportPaths=target/test-results/lcov.info"); } @@ -134,9 +130,7 @@ void shouldBuildBackendModule() { assertCommonModule(module) .hasFile("sonar-project.properties") - .containing( - "sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, build/classes/static/**/*.*, src/main/webapp/app/index.tsx" - ) + .containing("sonar.exclusions=\\") .notContaining("sonar.testExecutionReportPaths=build/test-results/TESTS-results-sonar.xml"); } @@ -148,9 +142,7 @@ void shouldBuildBackendFrontendModule() { assertCommonModule(module) .hasFile("sonar-project.properties") - .containing( - "sonar.exclusions=src/main/webapp/main.ts, src/main/webapp/app/main.ts, src/main/webapp/content/**/*.*, build/classes/static/**/*.*, src/main/webapp/app/index.tsx" - ) + .containing("sonar.exclusions=\\") .containing("sonar.testExecutionReportPaths=build/test-results/TESTS-results-sonar.xml") .containing("sonar.javascript.lcov.reportPaths=build/test-results/lcov.info"); }