Skip to content

Commit

Permalink
test: use Vitest workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Bansal authored and Rohan Bansal committed Apr 17, 2024
1 parent 70e791c commit 8009b04
Show file tree
Hide file tree
Showing 10 changed files with 778 additions and 307 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ jobs:

- name: Coverage Report
if: always() # Also generate the report if tests are failing
uses: davelosert/vitest-coverage-report-action@v1
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ./aform
file-coverage-mode: 'all'
vite-config-path: './vite.config.ts'

atable:
Expand Down Expand Up @@ -93,7 +94,8 @@ jobs:

- name: Coverage Report
if: always() # Also generate the report if tests are failing
uses: davelosert/vitest-coverage-report-action@v1
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ./atable
file-coverage-mode: 'all'
vite-config-path: './vite.config.ts'
8 changes: 4 additions & 4 deletions aform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"vue": "^3.2.47"
},
"devDependencies": {
"@stonecrop/atable": "workspace:*",
"@histoire/plugin-vue": "^0.16.1",
"@stonecrop/atable": "workspace:*",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitejs/plugin-vue": "^4.2.1",
"@vitest/coverage-c8": "^0.31.0",
"@vitest/ui": "^0.31.0",
"@vitest/coverage-v8": "^1.5.0",
"@vitest/ui": "^1.5.0",
"@vue/test-utils": "^2.3.2",
"cypress": "^12.11.0",
"eslint": "^8.40.0",
Expand All @@ -53,7 +53,7 @@
"jsdom": "^22.0.0",
"typescript": "^5.0.4",
"vite": "^4.3.5",
"vitest": "^0.31.0",
"vitest": "^1.5.0",
"vue-router": "^4"
},
"peerDependencies": {
Expand Down
12 changes: 7 additions & 5 deletions aform/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
coverage: {
lines: 50,
branches: 50,
functions: 50,
statements: 50,
provider: 'v8',
thresholds: {
lines: 50,
branches: 50,
functions: 50,
statements: 50,
},
// required for Github Actions CI
reporter: ['text', 'json-summary', 'json'],
reportsDirectory: './coverage',
Expand All @@ -63,7 +66,6 @@ export default defineConfig({
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
'**/.{eslint,mocha,prettier}rc.{js,cjs,yml}',
],
all: true,
skipFull: true,
},
},
Expand Down
8 changes: 4 additions & 4 deletions atable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"vue": "^3.2.47"
},
"devDependencies": {
"@stonecrop/aform": "workspace:*",
"@histoire/plugin-vue": "^0.16.1",
"@stonecrop/aform": "workspace:*",
"@types/uuid": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@vitejs/plugin-vue": "^4.2.1",
"@vitest/coverage-c8": "^0.31.0",
"@vitest/ui": "^0.31.0",
"@vitest/coverage-v8": "^1.5.0",
"@vitest/ui": "^1.5.0",
"@vue/test-utils": "^2.3.2",
"cypress": "^12.11.0",
"eslint": "^8.40.0",
Expand All @@ -53,7 +53,7 @@
"jsdom": "^22.0.0",
"typescript": "^5.0.4",
"vite": "^4.3.5",
"vitest": "^0.31.0",
"vitest": "^1.5.0",
"vue-router": "^4"
},
"peerDependencies": {
Expand Down
12 changes: 7 additions & 5 deletions atable/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
coverage: {
lines: 10,
branches: 10,
functions: 10,
statements: 10,
provider: 'v8',
thresholds: {
lines: 40,
branches: 40,
functions: 40,
statements: 40,
},
// required for Github Actions CI
reporter: ['text', 'json-summary', 'json'],
reportsDirectory: './coverage',
Expand All @@ -67,7 +70,6 @@ export default defineConfig({
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
'**/.{eslint,mocha,prettier}rc.{js,cjs,yml}',
],
all: true,
skipFull: true,
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "update coverage report",
"type": "patch",
"packageName": "@stonecrop/aform"
}
],
"packageName": "@stonecrop/aform",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "update coverage report",
"type": "patch",
"packageName": "@stonecrop/atable"
}
],
"packageName": "@stonecrop/atable",
"email": "[email protected]"
}
28 changes: 16 additions & 12 deletions common/config/rush/browser-approved-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/approved-packages.schema.json",
"packages": [
{
"name": "@histoire/plugin-vue",
"allowedCategories": [ "prototype", "utilities" ]
},
{
"name": "@miragejs/graphql",
"allowedCategories": [ "prototype", "utilities" ]
},
{
"name": "@monaco-editor/loader",
"allowedCategories": [ "prototype" ]
},
{
"name": "@stonecrop/aform",
"allowedCategories": [ "prototype" ]
Expand Down Expand Up @@ -30,18 +42,6 @@
"name": "@stonecrop/utilities",
"allowedCategories": [ "prototype" ]
},
{
"name": "@histoire/plugin-vue",
"allowedCategories": [ "prototype", "utilities" ]
},
{
"name": "@miragejs/graphql",
"allowedCategories": [ "prototype", "utilities" ]
},
{
"name": "@monaco-editor/loader",
"allowedCategories": [ "prototype" ]
},
{
"name": "@typescript-eslint/eslint-plugin",
"allowedCategories": [ "prototype", "utilities" ]
Expand All @@ -58,6 +58,10 @@
"name": "@vitest/coverage-c8",
"allowedCategories": [ "prototype", "utilities" ]
},
{
"name": "@vitest/coverage-v8",
"allowedCategories": [ "prototype" ]
},
{
"name": "@vitest/ui",
"allowedCategories": [ "prototype", "utilities" ]
Expand Down
Loading

0 comments on commit 8009b04

Please sign in to comment.