Skip to content

Commit

Permalink
build: reorganize npm script related to code coverage, and check cove…
Browse files Browse the repository at this point in the history
…rage during maven build
  • Loading branch information
murdos committed Dec 28, 2024
1 parent 91a45d1 commit c3db56c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
"test": "npm run test:watch",
"test:component": "start-server-and-test dev http://localhost:9000 'cypress open --e2e --config-file src/test/webapp/component/cypress-config.ts'",
"test:component:headless": "start-server-and-test dev http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'",
"test:coverage": "npm-run-all test:coverage:*",
"test:coverage:unit": "vitest run --coverage",
"test:coverage:component": "npm run test:component:headless",
"test:coverage:combine": "rimraf target/.nyc_output && cpy --flat target/frontend-coverage/unit-tests/coverage-final.json target/.nyc_output/ --rename=unit-{{basename}} && cpy --flat target/frontend-coverage/components-tests/coverage-final.json target/.nyc_output/ --rename=component-{{basename}} && nyc merge target/.nyc_output target/.nyc_output/frontend-combined-coverage.json",
"test:coverage:check": "nyc report",
"test:unit:coverage": "vitest run --coverage",
"test:coverage:check": "npm-run-all test:coverage:clean test:coverage:copy:* test:coverage:merge test:coverage:report",
"test:coverage:clean": "rimraf target/.nyc_output",
"test:coverage:copy:unit": "cpy --flat target/frontend-coverage/unit-tests/coverage-final.json target/.nyc_output/ --rename=unit-{{basename}}",
"test:coverage:copy:component": "cpy --flat target/frontend-coverage/components-tests/coverage-final.json target/.nyc_output/ --rename=component-{{basename}}",
"test:coverage:merge": "nyc merge target/.nyc_output target/.nyc_output/frontend-combined-coverage.json",
"test:coverage:report": "nyc report",
"test:watch": "vitest --",
"watch:": "npm-run-all --parallel watch:*",
"watch:test": "npm run test:watch",
Expand Down
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
</goals>
<phase>test</phase>
<configuration>
<arguments>run test:coverage</arguments>
<arguments>run test:unit:coverage</arguments>
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
</configuration>
</execution>
Expand All @@ -524,6 +524,17 @@
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
</configuration>
</execution>
<execution>
<id>front verify coverage</id>
<goals>
<goal>npm</goal>
</goals>
<phase>verify</phase>
<configuration>
<arguments>run test:coverage:check</arguments>
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
</configuration>
</execution>
</executions>
</plugin>

Expand Down

0 comments on commit c3db56c

Please sign in to comment.