Skip to content

Commit

Permalink
refactor: clean code and add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Renato Moor committed Dec 19, 2023
1 parent 3bab7e1 commit 6c2de2c
Show file tree
Hide file tree
Showing 25 changed files with 1,676 additions and 199 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
push:
branches: [main]

workflow_run:
workflows: [ "Test" ]
types:
- completed

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Test'
on:
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

permissions:
# Required to check out the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

steps:
- uses: actions/checkout@v4
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: 'Install Deps'
run: npm install
- name: 'Test'
run: npx vitest --coverage.enabled true
- name: 'Report Coverage'
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,6 @@ $RECYCLE.BIN/
# build type files
temp

.vitepress/cache/

.docs/.vitepress/cache/
.html
8 changes: 4 additions & 4 deletions docs/.vitepress/cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"hash": "5d17d9df",
"browserHash": "0cffc30a",
"hash": "f823169d",
"browserHash": "e7c7f712",
"optimized": {
"vue": {
"src": "../../../../node_modules/.pnpm/[email protected][email protected]/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "704b3f59",
"fileHash": "a7b7b125",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../../node_modules/.pnpm/@[email protected]/node_modules/@vue/devtools-api/lib/esm/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "7b6077bd",
"fileHash": "c9fcf624",
"needsInterop": false
}
},
Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"build": "tsc && vite build && api-extractor run",
"release": "release-it"
"release": "release-it",
"test": "vitest",
"coverage": "vitest run --coverage",
"test:ui": "vitest --ui"
},
"dependencies": {
"vue": "^3.3.8"
Expand All @@ -45,11 +48,15 @@
"@microsoft/api-extractor": "^7.38.3",
"@release-it/conventional-changelog": "^8.0.1",
"@types/node": "^20.9.0",
"@vitest/coverage-istanbul": "^1.0.4",
"@vitest/coverage-v8": "^1.0.4",
"@vitest/ui": "^1.0.4",
"eslint": "^8.53.0",
"release-it": "^17.0.0",
"typescript": "^5.2.2",
"unocss": "^0.57.3",
"vite": "^4.5.0",
"vitepress": "latest"
"vitepress": "latest",
"vitest": "^1.0.4"
}
}
Loading

0 comments on commit 6c2de2c

Please sign in to comment.