feat: fix code coverage workflow (#195)
* feat: create a dummy component for testing coverage workflow * feat: add test for dummy component * fix: delta * fix: command * fix: remove test file regexp * chore: break tests * fix: tests * feat: add test for footer component * fix: delete dummy component
This commit is contained in:
parent
e555c69e07
commit
a59e880559
7
.github/workflows/test-runner.yaml
vendored
7
.github/workflows/test-runner.yaml
vendored
@ -20,10 +20,5 @@ jobs:
|
||||
uses: anuraag016/Jest-Coverage-Diff@master
|
||||
with:
|
||||
fullCoverageDiff: false
|
||||
runCommand: 'yarn jest --collectCoverageFrom=''["src/**/*.{js,jsx,ts,tsx}"]'' --coverage --collectCoverage=true --coverageDirectory=''./'' --coverageReporters=''json-summary'' --forceExit --detectOpenHandles __tests__/**/*.test.*'
|
||||
runCommand: "yarn jest --coverage --collectCoverage=true --coverageDirectory='./' --coverageReporters='json-summary' --forceExit --detectOpenHandles"
|
||||
delta: 0.5
|
||||
# - name: Upload coverage reports to Codecov
|
||||
# uses: codecov/codecov-action@v3
|
||||
# with:
|
||||
# token: ${{ secrets.CODECOV_TOKEN }}
|
||||
# files: coverage/lcov.info
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,7 +7,7 @@
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
.coverage-summary.json
|
||||
coverage-summary.json
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
|
14
__tests__/Footer.test.tsx
Normal file
14
__tests__/Footer.test.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import { render, screen } from '@testing-library/react'
|
||||
|
||||
import Footer from 'components/Footer'
|
||||
|
||||
import packageJSON from '../package.json'
|
||||
|
||||
describe('<Footer />', () => {
|
||||
it('should render correctly', () => {
|
||||
render(<Footer />)
|
||||
|
||||
const content = screen.getByText(`v${packageJSON.version}`)
|
||||
expect(content).toBeInTheDocument()
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user