Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ jobs:
* [The example site](https://designsystem-dev.cancer.gov/${ process.env.BUILD_NAME }/example-site/)
`
})
- name: Create Code Coverage Placeholder
uses: marocchino/sticky-pull-request-comment@v2
if: startsWith(github.repository, 'NCIOCPL') && github.event_name == 'pull_request'
with:
header: code coverage
message: |
## Code Coverage
Please wait for build to complete.
## This clones and checks out.
- name: Checkout branch
uses: actions/checkout@v3
Expand Down Expand Up @@ -115,6 +123,21 @@ jobs:
run: yarn test
env:
CI: true
- name: Generate Code Coverage Report
uses: irongut/[email protected]
with:
filename: 'reports/coverage/**/cobertura-coverage.xml'
badge: true
format: markdown
output: both
- name: Update Code Coverage Comment
uses: marocchino/sticky-pull-request-comment@v2
if: startsWith(github.repository, 'NCIOCPL') && github.event_name == 'pull_request'
with:
header: code coverage
path: code-coverage-results.md
- name: Output Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
## Build all the things for publishing. This is a proxy for testing.
- name: Build Doc Site
run: yarn docs-artifact
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pids
lib-cov

# Coverage directory used by tools like istanbul
/reports
coverage
*.lcov

Expand Down
14 changes: 14 additions & 0 deletions docs/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
const path = require('path');
module.exports = {
collectCoverage: true,
// This needs to be turned on and the coverage
// improved.
// collectCoverageFrom: [
// 'src/**/*.{js,jsx,ts,tsx}',
// '!src/**/*.test.{js,jsx,ts,tsx}',
// '!**/__tests__/**',
// '!src/**/*.d.ts',
// '!src/**/*.mock.ts',
// '!src/**/index.ts',
// '!src/index.ts',
// ],
coverageReporters: ['cobertura', 'lcov', 'text'],
coverageDirectory: path.join(__dirname, '..', 'reports', 'coverage', 'docs'),
coverageThreshold: {
global: {
branches: 85,
Expand Down
10 changes: 10 additions & 0 deletions packages/ncids-js/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path';
import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
Expand Down Expand Up @@ -26,5 +27,14 @@ const config: Config.InitialOptions = {
lines: 85,
},
},
coverageReporters: ['cobertura', 'lcov', 'text'],
coverageDirectory: path.join(
__dirname,
'..',
'..',
'reports',
'coverage',
'ncids-js'
),
};
export default config;
20 changes: 20 additions & 0 deletions packages/ncids-react/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require('path');

module.exports = {
setupFilesAfterEnv: ["./rtl.setup.js"],
collectCoverage: true,
Expand All @@ -8,4 +10,22 @@ module.exports = {
lines: 85,
},
},
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.test.{js,jsx,ts,tsx}',
'!**/__tests__/**',
'!src/**/*.d.ts',
'!src/**/*.mock.ts',
'!src/**/index.ts',
'!src/index.ts',
],
coverageReporters: ['cobertura', 'lcov', 'text'],
coverageDirectory: path.join(
__dirname,
'..',
'..',
'reports',
'coverage',
'ncids-react'
),
};