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 10 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
files: junit.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
2 changes: 2 additions & 0 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-only-warn": "^1.0.3",
"eslint-plugin-prettier": "^4.2.1",
"jest-junit": "^15.0.0",
"prettier": "^2.7.1",
"typescript": "~4.4.2",
"web-vitals": "^2.1.0"
Expand All @@ -122,6 +123,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 --testResultsProcessor=jest-junit --reporters=default --reporters=jest-junit",
"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
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
15 changes: 15 additions & 0 deletions front/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11061,6 +11061,16 @@ jest-jasmine2@^26.6.3:
pretty-format "^26.6.2"
throat "^5.0.0"

jest-junit@^15.0.0:
version "15.0.0"
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-15.0.0.tgz#a47544ab42e9f8fe7ada56306c218e09e52bd690"
integrity sha512-Z5sVX0Ag3HZdMUnD5DFlG+1gciIFSy7yIVPhOdGUi8YJaI9iLvvBb530gtQL2CHmv0JJeiwRZenr0VrSR7frvg==
dependencies:
mkdirp "^1.0.4"
strip-ansi "^6.0.1"
uuid "^8.3.2"
xml "^1.0.1"

jest-leak-detector@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz#7717cf118b92238f2eba65054c8a0c9c653a91af"
Expand Down Expand Up @@ -18093,6 +18103,11 @@ xml-name-validator@^3.0.0:
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==

xml@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==

xmlchars@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"
Expand Down