Skip to content

Commit 8386b97

Browse files
Fabian Wilesalexeagle
authored andcommitted
feat(builtin): add coverage all: true support
1 parent 38f4f78 commit 8386b97

File tree

7 files changed

+116
-24
lines changed

7 files changed

+116
-24
lines changed

internal/coverage/lcov_merger-js.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function main() {
6060
reportsDirectory: c8OutputDir,
6161
tempDirectory: coverageDir,
6262
resolve: '',
63+
all: true,
6364
reporter: ['lcovonly']
6465
})
6566
.run();

internal/coverage/lcov_merger.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ async function main() {
9898
// tempDirectory as actually the dir that c8 will read from for the v8 json files
9999
tempDirectory: coverageDir,
100100
resolve: '',
101+
all: true,
101102
// TODO: maybe add an attribute to allow more reporters
102103
// or maybe an env var?
103104
reporter: ['lcovonly']

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"typescript": "^3.7.5",
9797
"unidiff": "1.0.1",
9898
"yarn": "1.22.0",
99-
"c8": "7.1.0",
99+
"c8": "7.5.0",
100100
"zone.js": "0.8.29"
101101
},
102102
"// resolutions/**/jest-serializer": "need to resolve to a version that doesn't have a /// <reference path='../v8.d.ts' /> in build/index.d.ts which exposes a bug in ts_library",

packages/jasmine/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"main": "index.js",
1919
"dependencies": {
2020
"jasmine-reporters": "~2.3.2",
21-
"c8": "~7.1.0"
21+
"c8": "~7.5.0"
2222
},
2323
"//1": "jasmine depends on jasmine-core, however since we require() it we need it hoisted to the top",
2424
"//2": "so we include jasmine-core explicitly as a peerDep",

packages/jasmine/test/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ jasmine_node_test(
111111

112112
ts_library(
113113
name = "coverage_test_srcs",
114-
srcs = ["coverage_source.ts"],
114+
srcs = [
115+
"coverage_source.ts",
116+
"coverage_source_uncovered.ts",
117+
],
115118
)
116119

117120
jasmine_node_test(
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// noting in this file should be required, so we can test the c8 feature all: true
2+
// which will pick up files that aren't directly referenced by test files
3+
// but are added to coverage as empty coverage
4+
export function notCalled(input: number) {
5+
return input * 13;
6+
}

yarn.lock

Lines changed: 102 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,24 +2426,24 @@ bytes@3.1.0:
24262426
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
24272427
integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==
24282428

2429-
c8@7.1.0:
2430-
version "7.1.0"
2431-
resolved "https://registry.yarnpkg.com/c8/-/c8-7.1.0.tgz#3978192fd94b0349bffd0ffd12b87b3219386c38"
2432-
integrity sha512-r4ba14DehwROz7Sm/JpwqL+s2FGGMiVmgnhAtYJ/jQcPpR7L+yEO3MUoQXHOFBetqd+mpTY5XiNY79QY6bYpnw==
2429+
c8@7.5.0:
2430+
version "7.5.0"
2431+
resolved "https://registry.yarnpkg.com/c8/-/c8-7.5.0.tgz#a69439ab82848f344a74bb25dc5dd4e867764481"
2432+
integrity sha512-GSkLsbvDr+FIwjNSJ8OwzWAyuznEYGTAd1pzb/Kr0FMLuV4vqYJTyjboDTwmlUNAG6jAU3PFWzqIdKrOt1D8tw==
24332433
dependencies:
24342434
"@bcoe/v8-coverage" "^0.2.3"
24352435
"@istanbuljs/schema" "^0.1.2"
2436-
find-up "^4.0.0"
2436+
find-up "^5.0.0"
24372437
foreground-child "^2.0.0"
24382438
furi "^2.0.0"
24392439
istanbul-lib-coverage "^3.0.0"
24402440
istanbul-lib-report "^3.0.0"
2441-
istanbul-reports "^3.0.0"
2441+
istanbul-reports "^3.0.2"
24422442
rimraf "^3.0.0"
24432443
test-exclude "^6.0.0"
2444-
v8-to-istanbul "^4.1.2"
2445-
yargs "^15.0.0"
2446-
yargs-parser "^16.0.0"
2444+
v8-to-istanbul "^7.1.0"
2445+
yargs "^16.0.0"
2446+
yargs-parser "^20.0.0"
24472447

24482448
cacache@^12.0.0:
24492449
version "12.0.4"
@@ -2783,6 +2783,15 @@ cliui@^6.0.0:
27832783
strip-ansi "^6.0.0"
27842784
wrap-ansi "^6.2.0"
27852785

2786+
cliui@^7.0.2:
2787+
version "7.0.4"
2788+
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
2789+
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
2790+
dependencies:
2791+
string-width "^4.2.0"
2792+
strip-ansi "^6.0.0"
2793+
wrap-ansi "^7.0.0"
2794+
27862795
clone@^1.0.2:
27872796
version "1.0.4"
27882797
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
@@ -3778,6 +3787,11 @@ es6-promisify@^5.0.0:
37783787
dependencies:
37793788
es6-promise "^4.0.3"
37803789

3790+
escalade@^3.1.1:
3791+
version "3.1.1"
3792+
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
3793+
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
3794+
37813795
escape-html@~1.0.3:
37823796
version "1.0.3"
37833797
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
@@ -4144,6 +4158,14 @@ find-up@^4.0.0, find-up@^4.1.0:
41444158
locate-path "^5.0.0"
41454159
path-exists "^4.0.0"
41464160

4161+
find-up@^5.0.0:
4162+
version "5.0.0"
4163+
resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
4164+
integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
4165+
dependencies:
4166+
locate-path "^6.0.0"
4167+
path-exists "^4.0.0"
4168+
41474169
find-yarn-workspace-root@^1.2.1:
41484170
version "1.2.1"
41494171
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db"
@@ -4372,7 +4394,7 @@ get-caller-file@^1.0.1:
43724394
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"
43734395
integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==
43744396

4375-
get-caller-file@^2.0.1:
4397+
get-caller-file@^2.0.1, get-caller-file@^2.0.5:
43764398
version "2.0.5"
43774399
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
43784400
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
@@ -5427,7 +5449,7 @@ istanbul-lib-source-maps@^4.0.0:
54275449
istanbul-lib-coverage "^3.0.0"
54285450
source-map "^0.6.1"
54295451

5430-
istanbul-reports@^3.0.0, istanbul-reports@^3.0.2:
5452+
istanbul-reports@^3.0.2:
54315453
version "3.0.2"
54325454
resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b"
54335455
integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==
@@ -6376,6 +6398,13 @@ locate-path@^5.0.0:
63766398
dependencies:
63776399
p-locate "^4.1.0"
63786400

6401+
locate-path@^6.0.0:
6402+
version "6.0.0"
6403+
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
6404+
integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
6405+
dependencies:
6406+
p-locate "^5.0.0"
6407+
63796408
lock-verify@^2.0.2, lock-verify@^2.1.0:
63806409
version "2.1.0"
63816410
resolved "https://registry.yarnpkg.com/lock-verify/-/lock-verify-2.1.0.tgz#fff4c918b8db9497af0c5fa7f6d71555de3ceb47"
@@ -7536,6 +7565,13 @@ p-limit@^2.0.0, p-limit@^2.2.0:
75367565
dependencies:
75377566
p-try "^2.0.0"
75387567

7568+
p-limit@^3.0.2:
7569+
version "3.1.0"
7570+
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
7571+
integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
7572+
dependencies:
7573+
yocto-queue "^0.1.0"
7574+
75397575
p-locate@^2.0.0:
75407576
version "2.0.0"
75417577
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
@@ -7557,6 +7593,13 @@ p-locate@^4.1.0:
75577593
dependencies:
75587594
p-limit "^2.2.0"
75597595

7596+
p-locate@^5.0.0:
7597+
version "5.0.0"
7598+
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
7599+
integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
7600+
dependencies:
7601+
p-limit "^3.0.2"
7602+
75607603
p-try@^1.0.0:
75617604
version "1.0.0"
75627605
resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
@@ -9989,7 +10032,7 @@ uuid@^3.3.3:
998910032
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
999010033
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
999110034

9992-
v8-to-istanbul@^4.0.1, v8-to-istanbul@^4.1.2:
10035+
v8-to-istanbul@^4.0.1:
999310036
version "4.1.3"
999410037
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.3.tgz#22fe35709a64955f49a08a7c7c959f6520ad6f20"
999510038
integrity sha512-sAjOC+Kki6aJVbUOXJbcR0MnbfjvBzwKZazEJymA2IX49uoOdEdk+4fBq5cXgYgiyKtAyrrJNtBZdOeDIF+Fng==
@@ -9998,6 +10041,15 @@ v8-to-istanbul@^4.0.1, v8-to-istanbul@^4.1.2:
999810041
convert-source-map "^1.6.0"
999910042
source-map "^0.7.3"
1000010043

10044+
v8-to-istanbul@^7.1.0:
10045+
version "7.1.0"
10046+
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-7.1.0.tgz#5b95cef45c0f83217ec79f8fc7ee1c8b486aee07"
10047+
integrity sha512-uXUVqNUCLa0AH1vuVxzi+MI4RfxEOKt9pBgKwHbgH7st8Kv2P1m+jvWNnektzBh5QShF3ODgKmUFCf38LnVz1g==
10048+
dependencies:
10049+
"@types/istanbul-lib-coverage" "^2.0.1"
10050+
convert-source-map "^1.6.0"
10051+
source-map "^0.7.3"
10052+
1000110053
validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4:
1000210054
version "3.0.4"
1000310055
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
@@ -10230,6 +10282,15 @@ wrap-ansi@^6.2.0:
1023010282
string-width "^4.1.0"
1023110283
strip-ansi "^6.0.0"
1023210284

10285+
wrap-ansi@^7.0.0:
10286+
version "7.0.0"
10287+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
10288+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
10289+
dependencies:
10290+
ansi-styles "^4.0.0"
10291+
string-width "^4.1.0"
10292+
strip-ansi "^6.0.0"
10293+
1023310294
wrappy@1:
1023410295
version "1.0.2"
1023510296
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -10321,6 +10382,11 @@ y18n@^4.0.0:
1032110382
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
1032210383
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
1032310384

10385+
y18n@^5.0.5:
10386+
version "5.0.5"
10387+
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18"
10388+
integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==
10389+
1032410390
yallist@^2.1.2:
1032510391
version "2.1.2"
1032610392
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
@@ -10355,14 +10421,6 @@ yargs-parser@^13.1.1:
1035510421
camelcase "^5.0.0"
1035610422
decamelize "^1.2.0"
1035710423

10358-
yargs-parser@^16.0.0:
10359-
version "16.1.0"
10360-
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1"
10361-
integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==
10362-
dependencies:
10363-
camelcase "^5.0.0"
10364-
decamelize "^1.2.0"
10365-
1036610424
yargs-parser@^18.1.0, yargs-parser@^18.1.1:
1036710425
version "18.1.2"
1036810426
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.2.tgz#2f482bea2136dbde0861683abea7756d30b504f1"
@@ -10371,6 +10429,11 @@ yargs-parser@^18.1.0, yargs-parser@^18.1.1:
1037110429
camelcase "^5.0.0"
1037210430
decamelize "^1.2.0"
1037310431

10432+
yargs-parser@^20.0.0, yargs-parser@^20.2.2:
10433+
version "20.2.4"
10434+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54"
10435+
integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==
10436+
1037410437
yargs-parser@^9.0.2:
1037510438
version "9.0.2"
1037610439
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077"
@@ -10429,7 +10492,7 @@ yargs@^13.0.0, yargs@^13.2.1:
1042910492
y18n "^4.0.0"
1043010493
yargs-parser "^13.1.1"
1043110494

10432-
yargs@^15.0.0, yargs@^15.3.1:
10495+
yargs@^15.3.1:
1043310496
version "15.3.1"
1043410497
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b"
1043510498
integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==
@@ -10446,6 +10509,19 @@ yargs@^15.0.0, yargs@^15.3.1:
1044610509
y18n "^4.0.0"
1044710510
yargs-parser "^18.1.1"
1044810511

10512+
yargs@^16.0.0:
10513+
version "16.2.0"
10514+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
10515+
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
10516+
dependencies:
10517+
cliui "^7.0.2"
10518+
escalade "^3.1.1"
10519+
get-caller-file "^2.0.5"
10520+
require-directory "^2.1.1"
10521+
string-width "^4.2.0"
10522+
y18n "^5.0.5"
10523+
yargs-parser "^20.2.2"
10524+
1044910525
yarn@1.22.0:
1045010526
version "1.22.0"
1045110527
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.0.tgz#acf82906e36bcccd1ccab1cfb73b87509667c881"
@@ -10456,6 +10532,11 @@ yeast@0.1.2:
1045610532
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
1045710533
integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk=
1045810534

10535+
yocto-queue@^0.1.0:
10536+
version "0.1.0"
10537+
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
10538+
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
10539+
1045910540
zone.js@0.8.29:
1046010541
version "0.8.29"
1046110542
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.29.tgz#8dce92aa0dd553b50bc5bfbb90af9986ad845a12"

0 commit comments

Comments
 (0)