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

[stonecrop] use Vitest workspaces #107

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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'
2 changes: 1 addition & 1 deletion aform/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ module.exports = {
'@typescript-eslint/no-unsafe-return': 'off',
},

ignorePatterns: ['.eslintrc.cjs', '*.config.ts', 'node_modules/', 'dist/'],
ignorePatterns: ['.eslintrc.cjs', '*.config.ts', '*.spec.ts', 'node_modules/', 'dist/'],
}
240 changes: 116 additions & 124 deletions aform/dist/aform.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/aform.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/aform.umd.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/aform.umd.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aform/dist/style.css

Large diffs are not rendered by default.

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
1 change: 1 addition & 0 deletions aform/src/components/AForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const childModels = computed({
},
set: newValue => {
// Find the component in modelValue and update it
// eslint-disable-next-line vue/no-mutating-props
props.modelValue[i].value = newValue
emit('update:modelValue', props.modelValue)
},
Expand Down
5 changes: 3 additions & 2 deletions aform/tests/aform.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'

import AForm from '@/components/AForm.vue'
import ATextInput from '@/components/form/ATextInput.vue'
import AForm from '../src/components/AForm.vue'
import ATextInput from '../src/components/form/ATextInput.vue'

describe('AForm Component', () => {
const form_schema = [
Expand All @@ -16,6 +16,7 @@ describe('AForm Component', () => {
const wrapper = mount(AForm, {
props: {
modelValue: form_schema,
data: {},
},
components: {
ATextInput,
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: 70,
branches: 70,
functions: 70,
statements: 70,
},
// 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
2 changes: 1 addition & 1 deletion atable/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ module.exports = {
'@typescript-eslint/no-unsafe-return': 'off',
},

ignorePatterns: ['.eslintrc.cjs', '*.config.ts', 'node_modules/', 'dist/'],
ignorePatterns: ['.eslintrc.cjs', '*.config.ts', '*.spec.ts', 'node_modules/', 'dist/'],
}
Loading
Loading