Skip to content

Commit e2af2b8

Browse files
committed
Add code coverage for font tests
1 parent 30ed527 commit e2af2b8

6 files changed

Lines changed: 398 additions & 3 deletions

File tree

.github/workflows/font_tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,16 @@ jobs:
5959

6060
- name: Run font tests
6161
run: npx gulp fonttest --headless
62+
63+
- name: Run font tests with code coverage
64+
run: npx gulp fonttest --headless --coverage --coverage-output build/coverage/font
65+
66+
- name: Upload results to Codecov
67+
uses: codecov/codecov-action@v5
68+
with:
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
fail_ci_if_error: true
71+
files: ./build/coverage/font/lcov.info
72+
flags: fonttest
73+
name: codecov-umbrella
74+
verbose: true

gulpfile.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,15 @@ function runTests(testsName, { bot = false, xfaOnly = false } = {}) {
731731
if (process.argv.includes("--headless")) {
732732
args.push("--headless");
733733
}
734+
if (process.argv.includes("--coverage")) {
735+
args.push("--coverage");
736+
}
737+
if (process.argv.includes("--coverage-output")) {
738+
args.push(
739+
"--coverage-output",
740+
process.argv[process.argv.indexOf("--coverage-output") + 1]
741+
);
742+
}
734743

735744
const testProcess = startNode(args, { cwd: TEST_DIR, stdio: "inherit" });
736745
testProcess.on("close", function (code) {

package-lock.json

Lines changed: 237 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"autoprefixer": "^10.4.24",
1616
"babel-loader": "^10.0.0",
1717
"babel-plugin-add-header-comment": "^1.0.3",
18+
"babel-plugin-istanbul": "^7.0.1",
1819
"c8": "^10.1.3",
1920
"cached-iterable": "^0.3.0",
2021
"caniuse-lite": "^1.0.30001769",
@@ -37,6 +38,9 @@
3738
"gulp-sourcemaps": "^3.0.0",
3839
"gulp-zip": "^6.1.0",
3940
"highlight.js": "^11.11.1",
41+
"istanbul-lib-coverage": "^3.2.2",
42+
"istanbul-lib-report": "^3.0.1",
43+
"istanbul-reports": "^3.2.0",
4044
"jasmine": "^5.13.0",
4145
"jsdoc": "^4.0.5",
4246
"jstransformer-nunjucks": "^1.2.0",

0 commit comments

Comments
 (0)