Skip to content

(aws-cdk): (enable text output in jest coverage reporters) #26078

@mrpackethead

Description

@mrpackethead

Describe the feature

A very small change here, to turn on text output for jest testing. Being able to get something that looks like the output below would be very helpful. The coverage reports are avaialble as html in other folders, but this gives the information very concisely where it is needed.

I do not think this would break anything. I've had it turned on for my work on the L2 Construct for lattice and i get clean builds both for my package and the bigger library.

=============================== Coverage summary ===============================
Statements   : 78.8% ( 238/302 )
Branches     : 56.14% ( 96/171 )
Functions    : 84.31% ( 43/51 )
Lines        : 80.67% ( 238/295 )
================================================================================
-------------------|---------|----------|---------|---------|-------------------------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                   
-------------------|---------|----------|---------|---------|-------------------------------------
All files          |    78.8 |    56.14 |   84.31 |   80.67 |                                     
 index.ts          |     100 |      100 |     100 |     100 |                                     
 listener.ts       |   91.66 |    82.19 |     100 |   92.52 | 294,298,302-303,335,396,401,406     
 logging.ts        |     100 |      100 |      75 |     100 |                                     
 service.ts        |   86.66 |    66.66 |   83.33 |   89.65 | 229,233,257                         
 servicenetwork.ts |   81.53 |    77.77 |   78.57 |   86.88 | 211,219,299,307,311,361,470-472     
 targetgroups.ts   |    87.5 |      100 |     100 |     100 |                                     
 targets.ts        |    52.5 |    24.32 |   78.57 |    52.5 | 144-147,182-185,215,227-230,351-402 
-------------------|---------|----------|---------|---------|-------------------------------------
Jest: "global" coverage threshold for statements (80%) not met: 78.8%
Jest: "global" coverage threshold for branches (80%) not met: 56.14%

in tools/@aws-cdk/cdk-build-tools/config/jest.config.js line 16-20, add 'text' to the arrary

coverageReporters: [
"lcov",
"html",
"text-summary",
"text",
],

Use Case

Its painful to have to open the html files, particually when i dont' ahve a browser easily avaiable

Proposed Solution

Add 'text' to the coverageReporters

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.85.0

Environment details (OS name and version, etc.)

N/A

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-configRelated to AWS Configeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions