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

front: test coverage #2493

Merged
merged 12 commits into from
Dec 6, 2022
Merged
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
26 changes: 23 additions & 3 deletions .github/workflows/front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,28 @@ jobs:
node-version: 16
cache: "yarn"
cache-dependency-path: front/yarn.lock
- run: yarn --cwd front install
- run: yarn --cwd front build

- name: install dependencies
run: yarn --cwd front install

- name: run front test suite
run: yarn --cwd front test-coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
# github runs PR workflows on the result of a merge commit.
# tell codecov the sha of the unmerged PR https://github.com/codecov/uploader/issues/525
override_commit: "${{ github.event.pull_request.head.sha }}"
name: codecov
flags: front
directory: ./front/test
files: cobertura-coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true

- name: build project
run: yarn --cwd front build
env:
CI: false
- run: yarn --cwd front --passWithNoTests test
7 changes: 7 additions & 0 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"start": "react-scripts start",
"build": "react-scripts --max_old_space_size=4096 build",
"test": "react-scripts test",
"test-coverage": "react-scripts test --watchAll=false --coverage --coverageDirectory=test",
"eject": "react-scripts eject",
"lint-ts": "eslint --ext .ts,.tsx src",
"generate-types": "npx @rtk-query/codegen-openapi src/common/api/openapi-config.js",
Expand Down Expand Up @@ -151,5 +152,11 @@
}
}
]
},
"jest": {
"coverageReporters": [
"text",
"cobertura"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function checkWrapperValidity<T = any>(
if (newLine)
assert.equal(
Math.round(last(result)?.end || 0),
Math.round(getLineStringDistance(newLine) * 1000),
Math.round(getLineStringDistance(newLine)),
message
);
// Checking the continuity
Expand Down