Skip to content

Commit

Permalink
chore(dev-deps): Upgrade vitest from 1.6 to 2.0 (wxt-dev#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 authored Jul 21, 2024
1 parent 1f216dd commit 34ae689
Show file tree
Hide file tree
Showing 11 changed files with 328 additions and 359 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: ./.github/actions/setup
- uses: oven-sh/setup-bun@v2
- name: pnpm test:coverage
run: pnpm test:coverage --reporter=default --reporter=hanging-process
run: pnpm test:coverage -- --reporter=default --reporter=hanging-process
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -44,7 +44,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm test run
- run: pnpm test
template:
runs-on: ubuntu-22.04
strategy:
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"packageManager": "[email protected]",
"scripts": {
"check": "check && pnpm -r --sequential run check",
"test": "vitest",
"test:coverage": "vitest run --coverage.enabled \"--coverage.include=packages/wxt/src/**\" \"--coverage.exclude=packages/wxt/src/core/utils/testing/**\" \"--coverage.exclude=**/*.d.ts\" \"--coverage.exclude=**/fixtures/**\"",
"test": "pnpm -r --sequential run test run",
"test:coverage": "pnpm -r --sequential run test:coverage",
"prepare": "simple-git-hooks",
"prepublish": "pnpm -s build",
"docs:gen": "typedoc --options docs/typedoc.json",
Expand All @@ -21,7 +21,7 @@
"@aklinker1/buildc": "^1.0.11",
"@aklinker1/check": "^1.3.1",
"@types/fs-extra": "^11.0.4",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.0",
"changelogen": "^0.5.5",
"consola": "^3.2.3",
"dependency-graph": "^1.0.0",
Expand All @@ -39,9 +39,7 @@
"typedoc-vitepress-theme": "1.0.0-next.3",
"typescript": "^5.5.3",
"vitepress": "^1.3.1",
"vitest": "^1.6.0",
"vitest-mock-extended": "^1.3.2",
"vitest-plugin-random-seed": "^1.1.0",
"vue": "^3.4.33",
"wxt": "workspace:*",
"yaml": "^2.4.5"
Expand Down
2 changes: 2 additions & 0 deletions packages/wxt-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"@types/react-dom": "^18.3.0",
"sass": "^1.77.8",
"typescript": "^5.5.3",
"vitest": "^2.0.0",
"vitest-plugin-random-seed": "^1.1.0",
"wxt": "workspace:*"
},
"buildc": {
Expand Down
3 changes: 2 additions & 1 deletion packages/wxt-demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": ["../../tsconfig.base.json", "./.wxt/tsconfig.json"],
"compilerOptions": {
"allowImportingTsExtensions": true,
"jsx": "react-jsx"
"jsx": "react-jsx",
"types": ["vitest-plugin-random-seed/types"]
}
}
6 changes: 4 additions & 2 deletions packages/wxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"check:default": "check",
"check:tsc-virtual": "tsc --noEmit -p src/virtual",
"test": "buildc --deps-only -- vitest",
"test:e2e": "buildc --deps-only -- vitest -r e2e",
"test:coverage": "pnpm test -- run --coverage",
"sync-releases": "pnpx changelogen@latest gh release",
"prepack": "pnpm build"
},
Expand Down Expand Up @@ -160,6 +160,8 @@
"publint": "^0.2.9",
"tsup": "^8.2.1",
"tsx": "4.15.7",
"typescript": "^5.5.3"
"typescript": "^5.5.3",
"vitest": "^2.0.0",
"vitest-plugin-random-seed": "^1.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import path from 'node:path';
let increment = 0;

export function bundleAnalysis(config: ResolvedConfig): vite.Plugin {
// @ts-expect-error: Vite version mismatch
return visualizer({
template: 'raw-data',
filename: path.resolve(
Expand Down
1 change: 1 addition & 0 deletions packages/wxt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["vitest-plugin-random-seed/types"],
"paths": {
"~/*": ["./src/*"]
}
Expand Down
20 changes: 11 additions & 9 deletions packages/wxt/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { defineProject } from 'vitest/config';
import { defineConfig } from 'vitest/config';
import path from 'node:path';
import RandomSeed from 'vitest-plugin-random-seed';
import fs from 'fs-extra';

// Clear e2e test projects
await fs.rm(path.resolve(__dirname, 'e2e/dist'), {
recursive: true,
force: true,
});

export default defineProject({
export default defineConfig({
test: {
mockReset: true,
restoreMocks: true,
setupFiles: ['vitest.setup.ts'],
testTimeout: 120e3,
coverage: {
include: ['src/**'],
exclude: ['**/dist', '**/__tests__', 'src/utils/testing'],
},
},
server: {
watch: {
ignored: '**/dist/**',
},
},
plugins: [RandomSeed()],
resolve: {
Expand Down
Loading

0 comments on commit 34ae689

Please sign in to comment.