11#!/usr/bin/env node
22
33import fs from 'node:fs' ;
4- import path , { dirname } from 'node:path' ;
5- import { fileURLToPath } from 'node:url' ;
4+ import path from 'node:path' ;
65
7- const __filename = fileURLToPath ( import . meta. url ) ;
8- const __dirname = dirname ( __filename ) ;
6+ const INCLUDED_PACKAGE_DIRS = [
7+ 'packages/sthrift-verification/acceptance-api' ,
8+ 'packages/sthrift-verification/acceptance-ui' ,
9+ 'apps/api' ,
10+ 'apps/docs' ,
11+ 'packages/cellix/api-services-spec' ,
12+ 'packages/cellix/arch-unit-tests' ,
13+ 'packages/cellix/domain-seedwork' ,
14+ 'packages/cellix/event-bus-seedwork-node' ,
15+ 'packages/cellix/mongoose-seedwork' ,
16+ 'packages/cellix/server-messaging-seedwork' ,
17+ 'packages/cellix/server-mongodb-memory-seedwork' ,
18+ 'packages/cellix/server-oauth2-seedwork' ,
19+ 'packages/cellix/server-payment-seedwork' ,
20+ 'packages/cellix/service-blob-storage' ,
21+ 'packages/cellix/service-messaging-base' ,
22+ 'packages/cellix/service-messaging-mock' ,
23+ 'packages/cellix/service-messaging-twilio' ,
24+ 'packages/cellix/service-mongoose' ,
25+ 'packages/cellix/service-otel' ,
26+ 'packages/cellix/service-payment-base' ,
27+ 'packages/cellix/service-payment-cybersource' ,
28+ 'packages/cellix/service-payment-mock' ,
29+ 'packages/cellix/service-sendgrid' ,
30+ 'packages/cellix/service-token-validation' ,
31+ 'packages/cellix/test-utils' ,
32+ ] ;
933
1034/**
1135 * Simple LCOV merger that combines multiple lcov.info files
@@ -39,21 +63,9 @@ function mergeLcovFiles() {
3963 fs . mkdirSync ( outputDir , { recursive : true } ) ;
4064 }
4165
42- // Find acceptance test lcov.info files
43- const lcovFiles = [ ] ;
44-
45- // Only include coverage from acceptance test packages
46- const acceptanceDirs = [
47- 'packages/sthrift-verification/acceptance-api' ,
48- 'packages/sthrift-verification/acceptance-ui' ,
49- ] ;
50-
51- for ( const dir of acceptanceDirs ) {
52- const lcovPath = path . join ( rootDir , dir , 'coverage' , 'lcov.info' ) ;
53- if ( fs . existsSync ( lcovPath ) ) {
54- lcovFiles . push ( lcovPath ) ;
55- }
56- }
66+ const lcovFiles = INCLUDED_PACKAGE_DIRS
67+ . map ( ( packageDir ) => path . join ( rootDir , packageDir , 'coverage' , 'lcov.info' ) )
68+ . filter ( ( lcovPath ) => fs . existsSync ( lcovPath ) ) ;
5769
5870 console . log ( `Found ${ lcovFiles . length } LCOV files:` ) ;
5971 lcovFiles . forEach ( file => console . log ( ` - ${ file } ` ) ) ;
@@ -100,4 +112,4 @@ function mergeLcovFiles() {
100112}
101113
102114// Run the merger
103- mergeLcovFiles ( ) ;
115+ mergeLcovFiles ( ) ;
0 commit comments