Skip to content

Commit

Permalink
🔥 chore: support vitest (#175)
Browse files Browse the repository at this point in the history
* 🔥 chore: support vitest

* 🔥 fix: sass warning
  • Loading branch information
pdsuwwz authored Nov 6, 2024
1 parent 17318d2 commit cf105f8
Show file tree
Hide file tree
Showing 10 changed files with 1,872 additions and 1,623 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.15.x
node-version: 18.12.x

- uses: pnpm/action-setup@v3
with:
version: 8
version: 9

- name: Install dependencies
run: pnpm install
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
## Environment Support

* Vue 3.x
* Node 16.15.x
* Node >= 18.12.x
* Pnpm 9.x
* VS Code 插件 `dbaeumer.vscode-eslint` >= v3.0.5 (pre-release)


Expand Down
4 changes: 1 addition & 3 deletions __tests__/IconFont.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/**
* @jest-environment jsdom
*/
import { describe, expect, it } from 'vitest'
import { mount } from '@vue/test-utils'
import IconFontComponent from '@/components/IconFont/index.vue'

Expand Down
4 changes: 1 addition & 3 deletions __tests__/hello.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/**
* @jest-environment jsdom
*/
import { expect, test } from 'vitest'
import { mount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld/index.vue'

Expand Down
1 change: 1 addition & 0 deletions __tests__/sum.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { expect, test } from 'vitest'
test('plus test', () => {
expect(2 + 3).toBe(5)
})
43 changes: 0 additions & 43 deletions jest.config.cjs

This file was deleted.

56 changes: 29 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"build": "vite build",
"deploy:gh-pages": "cross-env VITE_ROUTER_MODE=hash pnpm build",
"preview": "vite preview --host",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src",
"test": "jest",
"test:coverage": "jest --coverage"
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "vitest",
"test:coverage": "vitest --coverage"
},
"engines": {
"node": ">= 16.15.0",
"pnpm": ">= 8.14.x"
"node": ">=18.12.0",
"pnpm": ">= 9.x"
},
"keywords": [
"vue",
Expand Down Expand Up @@ -50,45 +50,47 @@
"@fortawesome/free-regular-svg-icons": "6.6.0",
"@fortawesome/free-solid-svg-icons": "6.6.0",
"@fortawesome/vue-fontawesome": "~3.0.8",
"axios": "1.7.2",
"axios": "1.7.7",
"echarts": "^5.5.1",
"element-plus": "2.7.7",
"element-plus": "2.8.3",
"js-cookie": "^3.0.5",
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
"pinia": "^2.1.7",
"vue": "^3.4.33",
"vue-router": "^4.4.0"
"pinia": "^2.2.6",
"vue": "^3.5.12",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@babel/core": "^7.24.9",
"@babel/eslint-parser": "^7.24.8",
"@babel/preset-env": "^7.24.8",
"@eslint/js": "^9.7.0",
"@stylistic/eslint-plugin": "^2.3.0",
"@stylistic/stylelint-plugin": "^2.1.2",
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@eslint/js": "^9.14.0",
"@stylistic/eslint-plugin": "^2.10.1",
"@stylistic/stylelint-plugin": "^3.1.1",
"@sucrase/jest-plugin": "^3.0.0",
"@vitejs/plugin-vue": "^5.1.0",
"@vue/compiler-sfc": "^3.4.33",
"@vitejs/plugin-vue": "^5.1.4",
"@vitest/coverage-v8": "^2.1.4",
"@vue/compiler-sfc": "^3.5.12",
"@vue/test-utils": "^2.4.6",
"@vue/vue3-jest": "29.2.6",
"babel-jest": "^29.7.0",
"babel-plugin-transform-vite-meta-env": "^1.0.3",
"cross-env": "^7.0.3",
"eslint": "^9.7.0",
"eslint": "^9.14.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "7.0.0",
"eslint-plugin-vue": "9.27.0",
"globals": "^15.8.0",
"eslint-plugin-promise": "7.1.0",
"eslint-plugin-vue": "9.30.0",
"globals": "^15.12.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-transform-stub": "^2.0.0",
"rollup": "^4.19.0",
"sass": "1.77.6",
"rollup": "^4.24.4",
"sass": "1.78.0",
"sucrase": "^3.35.0",
"vite": "^5.3.4"
"vite": "^5.4.10",
"vitest": "^2.1.4"
}
}
Loading

0 comments on commit cf105f8

Please sign in to comment.