Skip to content

Commit

Permalink
Obtain test coverage for demo/parser
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson committed Sep 25, 2023
1 parent a0df7bc commit 58a3d9e
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ jobs:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
fetch-depth: 0
submodules: recursive

- name: Setup Node 20
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 20.x

- name: demo/parser
run: |
set -e
npm ci
npm run test:coverage
working-directory: demo/parser

- uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions demo/parser/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/bin/cli
/bin/cli.js
/coverage
/node_modules
207 changes: 207 additions & 0 deletions demo/parser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions demo/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"format": "prettier --write '**/*.{mjs,js,json,ts}'",
"lint": "tsc && eslint '**/*.{mjs,js,ts}' --quiet --fix",
"test": "vitest",
"test:coverage": "vitest --coverage --no-watch",
"vercel-build": "npm run build:api"
},
"devDependencies": {
Expand All @@ -20,6 +21,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"@vercel/node": "^2.11.0",
"@vitest/coverage-v8": "^0.34.5",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
9 changes: 9 additions & 0 deletions demo/parser/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
coverage: {
reporter: ["lcov", "text-summary"],
},
},
});
3 changes: 3 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ sonar.organization=daohoangson
sonar.exclusions=data/**, \
history/data/**, \
transformers/js-dvhcvn/src/data.ts
sonar.tests=**/*.spec.ts

sonar.javascript.lcov.reportPaths=coverage/lcov.info

sonar.python.version=3.11

0 comments on commit 58a3d9e

Please sign in to comment.