diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e0ea547e4f020993c36a53460979b43e0d57f4c..1967e4afeacc6e81ad68eca7d0ccb97337f32f3d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -298,7 +298,7 @@ test-frontend: - build-frontend script: - "make test-frontend" - - "cat ./fda-analyse-service/coverage.txt | grep -o 'TOTAL[^%]*%'" + - "cat ./fda-ui/coverage.txt | grep -o 'Lines[^%]*%'" artifacts: when: always paths: diff --git a/Makefile b/Makefile index 66f7d69cf3b835a61b7446ccf98eebfdf3f69e16..a5bce8de2e48b1547e456f13be75256590b415c9 100644 --- a/Makefile +++ b/Makefile @@ -190,6 +190,7 @@ coverage-frontend: build-frontend test-frontend: clean build-frontend yarn --cwd ./fda-ui install yarn --cwd ./fda-ui run test:unit || true + yarn --cwd ./fda-ui run coverage || true clean: docker system prune -f --volumes diff --git a/fda-ui/.gitignore b/fda-ui/.gitignore index 6e6e590a03c7704d79c826c1a550cdd3d0fe7dfd..a6a8dd571f3fc30997a2b59aab90d21abc4aff7c 100644 --- a/fda-ui/.gitignore +++ b/fda-ui/.gitignore @@ -21,6 +21,7 @@ lib-cov # Coverage directory used by tools like istanbul coverage/ +coverage.txt # nyc test coverage .nyc_output diff --git a/fda-ui/.nycrc b/fda-ui/.nycrc index ccda5111b9ac9d41694692f5c4e0a12dadc6fbbb..a4841b7947c1e8e06b5ca816319f1eb0f20b952e 100644 --- a/fda-ui/.nycrc +++ b/fda-ui/.nycrc @@ -6,7 +6,7 @@ "branches": 35, "check-coverage": true, "include": [ "components/**/*.vue", "layouts/**/*.vue", "pages/**/*.vue", "server-middleware/**/*.js", "store/**/*.js"], - "exclude": ["node_modules"], + "exclude": ["node_modules", "server-middleware", "store"], "extension": [".js", ".vue"], "reporter": [ "lcov", diff --git a/fda-ui/package.json b/fda-ui/package.json index bb9ddae2dc4c9bedf488275eda92ae855faa54b0..1649177b07b97389c2827d1c565f2db4f7e77ca9 100644 --- a/fda-ui/package.json +++ b/fda-ui/package.json @@ -12,7 +12,7 @@ "ver": "nuxt --version", "lint:js": "eslint --ext .js,.vue --ignore-path .gitignore .", "lint": "yarn lint:js", - "coverage": "nyc ava test/unit/**/* test/specs/**/*", + "coverage": "nyc ava test/unit/**/* test/specs/**/* > ./coverage.txt", "test:unit": "ava test/unit/**/* test/specs/**/*", "test:watch": "ava --watch test/unit/**/* test/specs/**/*", "test:e2e": "yarn clean && cross-env PORT=3001 ava --timeout=2h --fail-fast test/e2e/**",