Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add jest coverage #42

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ jobs:
yarn global add @lhci/[email protected]
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

- name: Test and generate coverage report
uses: artiomtr/[email protected]
with:
apurv-wednesday marked this conversation as resolved.
Show resolved Hide resolved
github-token: ${{ secrets.GITHUB_TOKEN }}
package-manager: yarn
custom-title: Jest Coverage Report
12 changes: 11 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ const createJestConfig = nextJest({ dir: "./" });
const jestConfig: Config = {
preset: "ts-jest",
testEnvironment: "jsdom",
// uncomment later after adding tests
apurv-wednesday marked this conversation as resolved.
Show resolved Hide resolved
// coverageThreshold: {
// global: {
// statements: 90,
// branches: 90,
// functions: 90,
// lines: 90,
// },
// },
coverageReporters: ["json-summary", "text", "lcov"],
collectCoverageFrom: ["src/**/**/*.{js,jsx,ts,tsx}"],
reporters: [
"default",
Expand Down Expand Up @@ -54,7 +64,7 @@ const jestConfig: Config = {
"<rootDir>/coverage/",
"<rootDir>/babel.config.js",
"<rootDir>/lingui.config.js",
"<rootDir>/jest.config.js",
"<rootDir>/jest.config.ts",
"<rootDir>/jest.setup.js",
"<rootDir>/next-env.d.ts",
"<rootDir>/next.config.js",
Expand Down
Loading