Skip to content

Commit

Permalink
fix: add vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
cc-hearts committed Sep 11, 2024
1 parent 5283904 commit 7f52f17
Show file tree
Hide file tree
Showing 10 changed files with 1,072 additions and 813 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
"typescript": "^5.3.3",
"vitepress": "1.0.0-rc.33",
"vitepress-theme-demoblock": "^3.0.7",
"vitest": "^1.1.1",
"vitest": "^2.0.5",
"vue": "^3.5.4",
"happy-dom": "^15.7.3",
"vue-tsc": "^2.0.29"
},
"lint-staged": {
Expand Down
1 change: 0 additions & 1 deletion packages/ant-design-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"peerDependencies": {
"vue": ">=3.4.0",
"@ant-design/icons-vue": "^7.0.0",
"ant-design-vue": ">=4.1.0"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/element-plus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
},
"peerDependencies": {
"@element-plus/icons-vue": ">=2.3.1",
"element-plus": ">=2.4.3",
"vue": ">=3.4.0"
"element-plus": ">=2.4.3"
},
"devDependencies": {
"@packages/vue-utils": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`collapsed card modules > collapsed card snapshot 1`] = `
"<div class="cc-collapse-card">
<div class="cc-collapse-card-title">
<div class="cc-collapse-card-title__default">
<div class="cc-collapse-card-arrow"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
<path fill="currentColor" d="M11.475 14.475L7.85 10.85q-.075-.075-.112-.162T7.7 10.5q0-.2.138-.35T8.2 10h7.6q.225 0 .363.15t.137.35q0 .05-.15.35l-3.625 3.625q-.125.125-.25.175T12 14.7q-.15 0-.275-.05t-.25-.175Z"></path>
</svg></div><span class="cc-collapse-card-title__text"></span>
</div>
</div>
<transition-stub name="el-collapse-transition" appear="false" persisted="false" css="true">
<div style="display: none;">
<div class="cc-collapse-card-content"></div>
</div>
</transition-stub>
</div>"
`;
11 changes: 11 additions & 0 deletions packages/element-plus/tests/collapsed-card/collapsed-card.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { mount } from '@vue/test-utils'
import { describe, test, expect } from 'vitest'
import CollapsedCard from '../../../element-plus/components/collapse-card/collapse-card.vue'

describe('collapsed card modules', () => {
test('collapsed card snapshot', () => {
const wrapper = mount(CollapsedCard)

expect(wrapper.html()).toMatchSnapshot()
})
})
3 changes: 0 additions & 3 deletions packages/helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"exports": {
"./*": "./*"
},
"peerDependencies": {
"vue": ">=3.4.0"
},
"author": "Carl Chen",
"license": "MIT"
}
3 changes: 1 addition & 2 deletions packages/vue-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"vue-tsc": "^2.0.6"
},
"dependencies": {
"monaco-editor": "^0.46.0",
"vue": "^3.3.9"
"monaco-editor": "^0.46.0"
}
}
3 changes: 0 additions & 3 deletions packages/vue-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"author": "Carl Chen",
"type": "module",
"license": "MIT",
"dependencies": {
"vue": "^3.3.9"
},
"scripts": {
"build": "npx rimraf ./dist && rollup -c && tsc -p tsconfig.build.json"
},
Expand Down
Loading

0 comments on commit 7f52f17

Please sign in to comment.