From 2ac326245678745b5395859da784f117cb025323 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 10:33:53 +0100
Subject: [PATCH 01/16] chore(deps): update actions/cache action to v4 (#5137)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/actions/setup-and-cache/action.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/actions/setup-and-cache/action.yml b/.github/actions/setup-and-cache/action.yml
index 123ee818ba25..3f708fb8e596 100644
--- a/.github/actions/setup-and-cache/action.yml
+++ b/.github/actions/setup-and-cache/action.yml
@@ -46,7 +46,7 @@ runs:
run: echo "Failed to resolve package versions. See log above." && exit 1
- name: Cache Cypress v${{ steps.resolve-package-versions.outputs.CYPRESS_VERSION }}
- uses: actions/cache@v3
+ uses: actions/cache@v4
id: cypress-cache
with:
path: ${{ env.CYPRESS_CACHE_FOLDER }}
@@ -55,7 +55,7 @@ runs:
${{ runner.os }}-cypress-
- name: Cache Playwright v${{ steps.resolve-package-versions.outputs.PLAYWRIGHT_VERSION }}
- uses: actions/cache@v3
+ uses: actions/cache@v4
id: playwright-cache
with:
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
From c485708b749c3d1880abbacdd1a3850b453f76b1 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 10:34:38 +0100
Subject: [PATCH 02/16] chore(deps): update actions/github-script action to v7
(#5138)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/ecosystem-ci-trigger.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ecosystem-ci-trigger.yml b/.github/workflows/ecosystem-ci-trigger.yml
index bcbd8c765f73..c94b92024a4e 100644
--- a/.github/workflows/ecosystem-ci-trigger.yml
+++ b/.github/workflows/ecosystem-ci-trigger.yml
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'vitest-dev/vitest' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
steps:
- - uses: actions/github-script@v6
+ - uses: actions/github-script@v7
with:
script: |
const user = context.payload.sender.login
@@ -45,7 +45,7 @@ jobs:
})
throw new Error('not allowed')
}
- - uses: actions/github-script@v6
+ - uses: actions/github-script@v7
id: get-pr-data
with:
script: |
@@ -66,7 +66,7 @@ jobs:
app_id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
installation_retrieval_payload: '${{ github.repository_owner }}/vitest-ecosystem-ci'
private_key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
- - uses: actions/github-script@v6
+ - uses: actions/github-script@v7
id: trigger
env:
COMMENT: ${{ github.event.comment.body }}
From ef55724377b9fe1032bcdcb24160d9a58096c7bb Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 10:35:14 +0100
Subject: [PATCH 03/16] fix(deps): update dependency strip-literal to v2
(#5136)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
packages/vitest/package.json | 2 +-
pnpm-lock.yaml | 12 +++++++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/packages/vitest/package.json b/packages/vitest/package.json
index a561c277da5f..2c75e6801ff0 100644
--- a/packages/vitest/package.json
+++ b/packages/vitest/package.json
@@ -156,7 +156,7 @@
"pathe": "^1.1.1",
"picocolors": "^1.0.0",
"std-env": "^3.5.0",
- "strip-literal": "^1.3.0",
+ "strip-literal": "^2.0.0",
"tinybench": "^2.5.1",
"tinypool": "^0.8.2",
"vite": "^5.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 172c77b13479..57bff926bef1 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1343,8 +1343,8 @@ importers:
specifier: ^3.5.0
version: 3.5.0
strip-literal:
- specifier: ^1.3.0
- version: 1.3.0
+ specifier: ^2.0.0
+ version: 2.0.0
tinybench:
specifier: ^2.5.1
version: 2.5.1
@@ -19045,7 +19045,6 @@ packages:
/js-tokens@8.0.2:
resolution: {integrity: sha512-Olnt+V7xYdvGze9YTbGFZIfQXuGV4R3nQwwl8BrtgaPE/wq8UFpUHWuTNc05saowhSr1ZO6tx+V6RjE9D5YQog==}
- dev: true
/js-yaml@3.14.1:
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
@@ -24336,6 +24335,13 @@ packages:
resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==}
dependencies:
acorn: 8.10.0
+ dev: true
+
+ /strip-literal@2.0.0:
+ resolution: {integrity: sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==}
+ dependencies:
+ js-tokens: 8.0.2
+ dev: false
/style-loader@1.3.0(webpack@4.46.0):
resolution: {integrity: sha512-V7TCORko8rs9rIqkSrlMfkqA63DfoGBBJmK1kKGCcSi+BWb4cqz0SRsnp4l6rU5iwOEd0/2ePv68SV22VXon4Q==}
From 4bc59f505f0125c4763b513b0e87153fff048570 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 10:45:10 +0100
Subject: [PATCH 04/16] chore(deps): update dependency happy-dom to v13 (#5140)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
packages/vitest/package.json | 2 +-
pnpm-lock.yaml | 13 +++++++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/packages/vitest/package.json b/packages/vitest/package.json
index 2c75e6801ff0..2d8c6eac46c0 100644
--- a/packages/vitest/package.json
+++ b/packages/vitest/package.json
@@ -184,7 +184,7 @@
"find-up": "^6.3.0",
"flatted": "^3.2.9",
"get-tsconfig": "^4.7.2",
- "happy-dom": "^12.10.3",
+ "happy-dom": "^13.3.8",
"jsdom": "^24.0.0",
"log-update": "^5.0.1",
"micromatch": "^4.0.5",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 57bff926bef1..4df17c4f2842 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1422,8 +1422,8 @@ importers:
specifier: ^4.7.2
version: 4.7.2
happy-dom:
- specifier: ^12.10.3
- version: 12.10.3
+ specifier: ^13.3.8
+ version: 13.3.8
jsdom:
specifier: ^24.0.0
version: 24.0.0
@@ -17142,6 +17142,15 @@ packages:
whatwg-mimetype: 3.0.0
dev: true
+ /happy-dom@13.3.8:
+ resolution: {integrity: sha512-RAbq4oYfJNkVan1m1F3jfA4YEyRY0/ASoNvZsNJbuX85jIypidmsz9jQZD7Tqz0VXA2MhAGfcsh5oshwmwNYSg==}
+ engines: {node: '>=16.0.0'}
+ dependencies:
+ entities: 4.5.0
+ webidl-conversions: 7.0.0
+ whatwg-mimetype: 3.0.0
+ dev: true
+
/has-ansi@2.0.0:
resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==}
engines: {node: '>=0.10.0'}
From dd2b87ee28fca8cb5a0d37047313ca35f791033a Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 11:20:50 +0100
Subject: [PATCH 05/16] chore(deps): update dependency
@types/ungap__structured-clone to v1 (#5146)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
packages/web-worker/package.json | 2 +-
pnpm-lock.yaml | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/packages/web-worker/package.json b/packages/web-worker/package.json
index c3d450d63d47..c54b54e3026e 100644
--- a/packages/web-worker/package.json
+++ b/packages/web-worker/package.json
@@ -46,7 +46,7 @@
},
"devDependencies": {
"@types/debug": "^4.1.12",
- "@types/ungap__structured-clone": "^0.3.3",
+ "@types/ungap__structured-clone": "^1.2.0",
"@ungap/structured-clone": "^1.2.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4df17c4f2842..6f089c79f6c8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1462,8 +1462,8 @@ importers:
specifier: ^4.1.12
version: 4.1.12
'@types/ungap__structured-clone':
- specifier: ^0.3.3
- version: 0.3.3
+ specifier: ^1.2.0
+ version: 1.2.0
'@ungap/structured-clone':
specifier: ^1.2.0
version: 1.2.0
@@ -9612,8 +9612,8 @@ packages:
source-map: 0.6.1
dev: true
- /@types/ungap__structured-clone@0.3.3:
- resolution: {integrity: sha512-RNmhIPwoip6K/zZOv3ypksTAqaqLEXvlNSXKyrC93xMSOAHZCR7PifW6xKZCwkbbnbM9dwB9X56PPoNTlNwEqw==}
+ /@types/ungap__structured-clone@1.2.0:
+ resolution: {integrity: sha512-ZoaihZNLeZSxESbk9PUAPZOlSpcKx81I1+4emtULDVmBLkYutTcMlCj2K9VNlf9EWODxdO6gkAqEaLorXwZQVA==}
dev: true
/@types/unist@2.0.6:
From 16b3ab3aa354eb82008de72bc75ea07a86b589a1 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 11:26:02 +0100
Subject: [PATCH 06/16] chore(deps): update dependency @vitejs/plugin-vue to v5
(#5147)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
packages/ui/package.json | 2 +-
pnpm-lock.yaml | 22 +++++++++++-----------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 59f57cadbe24..6864fc88ea25 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -66,7 +66,7 @@
"@types/d3-selection": "^3.0.10",
"@types/ws": "^8.5.9",
"@unocss/reset": "^0.57.4",
- "@vitejs/plugin-vue": "^4.4.1",
+ "@vitejs/plugin-vue": "^5.0.3",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vitest/runner": "workspace:*",
"@vitest/ws-client": "workspace:*",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6f089c79f6c8..d9ee5ebd9f0c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1179,8 +1179,8 @@ importers:
specifier: ^0.57.4
version: 0.57.4
'@vitejs/plugin-vue':
- specifier: ^4.4.1
- version: 4.4.1(vite@5.0.12)(vue@3.3.8)
+ specifier: ^5.0.3
+ version: 5.0.3(vite@5.0.12)(vue@3.3.8)
'@vitejs/plugin-vue-jsx':
specifier: ^3.0.2
version: 3.0.2(vite@5.0.12)(vue@3.3.8)
@@ -10210,8 +10210,8 @@ packages:
- supports-color
dev: true
- /@vitejs/plugin-vue@4.4.1(vite@5.0.12)(vue@3.3.8):
- resolution: {integrity: sha512-HCQG8VDFDM7YDAdcj5QI5DvUi+r6xvo9LgvYdk7LSkUNwdpempdB5horkMSZsbdey9Ywsf5aaU8kEPw9M5kREA==}
+ /@vitejs/plugin-vue@4.5.0(vite@5.0.12)(vue@3.3.8):
+ resolution: {integrity: sha512-a2WSpP8X8HTEww/U00bU4mX1QpLINNuz/2KMNpLsdu3BzOpak3AGI1CJYBTXcc4SPhaD0eNRUp7IyQK405L5dQ==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
vite: ^5.0.12
@@ -10221,26 +10221,26 @@ packages:
vue: 3.3.8(typescript@5.2.2)
dev: true
- /@vitejs/plugin-vue@4.5.0(vite@5.0.12)(vue@3.3.8):
- resolution: {integrity: sha512-a2WSpP8X8HTEww/U00bU4mX1QpLINNuz/2KMNpLsdu3BzOpak3AGI1CJYBTXcc4SPhaD0eNRUp7IyQK405L5dQ==}
- engines: {node: ^14.18.0 || >=16.0.0}
+ /@vitejs/plugin-vue@5.0.2(vite@5.0.12)(vue@3.4.5):
+ resolution: {integrity: sha512-kEjJHrLb5ePBvjD0SPZwJlw1QTRcjjCA9sB5VyfonoXVBxTS7TMnqL6EkLt1Eu61RDeiuZ/WN9Hf6PxXhPI2uA==}
+ engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
vite: ^5.0.12
vue: ^3.2.25
dependencies:
vite: 5.0.12(@types/node@20.11.5)(less@4.1.3)
- vue: 3.3.8(typescript@5.2.2)
+ vue: 3.4.5(typescript@5.2.2)
dev: true
- /@vitejs/plugin-vue@5.0.2(vite@5.0.12)(vue@3.4.5):
- resolution: {integrity: sha512-kEjJHrLb5ePBvjD0SPZwJlw1QTRcjjCA9sB5VyfonoXVBxTS7TMnqL6EkLt1Eu61RDeiuZ/WN9Hf6PxXhPI2uA==}
+ /@vitejs/plugin-vue@5.0.3(vite@5.0.12)(vue@3.3.8):
+ resolution: {integrity: sha512-b8S5dVS40rgHdDrw+DQi/xOM9ed+kSRZzfm1T74bMmBDCd8XO87NKlFYInzCtwvtWwXZvo1QxE2OSspTATWrbA==}
engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
vite: ^5.0.12
vue: ^3.2.25
dependencies:
vite: 5.0.12(@types/node@20.11.5)(less@4.1.3)
- vue: 3.4.5(typescript@5.2.2)
+ vue: 3.3.8(typescript@5.2.2)
dev: true
/@volar/language-core@1.10.4:
From 9fbccde2a2f55cda9fc3c533e148c1087911f050 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 11:26:15 +0100
Subject: [PATCH 07/16] chore(deps): update dependency npm-run-all2 to v6
(#5149)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
package.json | 2 +-
pnpm-lock.yaml | 42 +++++++++++++++++++++++++++---------------
2 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/package.json b/package.json
index 451edc048580..c1501075bd74 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,7 @@
"fast-glob": "^3.3.2",
"lint-staged": "^15.1.0",
"magic-string": "^0.30.5",
- "npm-run-all2": "^5.0.0",
+ "npm-run-all2": "^6.1.2",
"pathe": "^1.1.1",
"rimraf": "^5.0.5",
"rollup": "^4.9.6",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d9ee5ebd9f0c..30ef2c78a1d9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -73,8 +73,8 @@ importers:
specifier: ^0.30.5
version: 0.30.5
npm-run-all2:
- specifier: ^5.0.0
- version: 5.0.2
+ specifier: ^6.1.2
+ version: 6.1.2
pathe:
specifier: ^1.1.1
version: 1.1.1
@@ -19311,6 +19311,11 @@ packages:
/json-parse-even-better-errors@2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
+ /json-parse-even-better-errors@3.0.1:
+ resolution: {integrity: sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==}
+ engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
+ dev: true
+
/json-schema-traverse@0.4.1:
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
dev: true
@@ -20834,17 +20839,22 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /npm-run-all2@5.0.2:
- resolution: {integrity: sha512-S2G6FWZ3pNWAAKm2PFSOtEAG/N+XO/kz3+9l6V91IY+Y3XFSt7Lp7DV92KCgEboEW0hRTu0vFaMe4zXDZYaOyA==}
- engines: {node: '>= 10'}
+ /npm-normalize-package-bin@3.0.1:
+ resolution: {integrity: sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==}
+ engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
+ dev: true
+
+ /npm-run-all2@6.1.2:
+ resolution: {integrity: sha512-WwwnS8Ft+RpXve6T2EIEVpFLSqN+ORHRvgNk3H9N62SZXjmzKoRhMFg3I17TK3oMaAEr+XFbRirWS2Fn3BCPSg==}
+ engines: {node: ^14.18.0 || >=16.0.0, npm: '>= 8'}
hasBin: true
dependencies:
- ansi-styles: 5.2.0
+ ansi-styles: 6.2.1
cross-spawn: 7.0.3
memorystream: 0.3.1
- minimatch: 3.1.2
- pidtree: 0.5.0
- read-pkg: 5.2.0
+ minimatch: 9.0.3
+ pidtree: 0.6.0
+ read-package-json-fast: 3.0.2
shell-quote: 1.7.4
dev: true
@@ -21554,12 +21564,6 @@ packages:
engines: {node: '>=10'}
dev: true
- /pidtree@0.5.0:
- resolution: {integrity: sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==}
- engines: {node: '>=0.10'}
- hasBin: true
- dev: true
-
/pidtree@0.6.0:
resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}
engines: {node: '>=0.10'}
@@ -22529,6 +22533,14 @@ packages:
dependencies:
loose-envify: 1.4.0
+ /read-package-json-fast@3.0.2:
+ resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==}
+ engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
+ dependencies:
+ json-parse-even-better-errors: 3.0.1
+ npm-normalize-package-bin: 3.0.1
+ dev: true
+
/read-pkg-up@1.0.1:
resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==}
engines: {node: '>=0.10.0'}
From 0eda22996f1a9fc4ed39e1dd987af4eb745bcc20 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 11:26:24 +0100
Subject: [PATCH 08/16] chore(deps): update dessant/lock-threads action to v5
(#5150)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/lock-closed-issues.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/lock-closed-issues.yml b/.github/workflows/lock-closed-issues.yml
index 4a98f9371f02..703ebd04ec32 100644
--- a/.github/workflows/lock-closed-issues.yml
+++ b/.github/workflows/lock-closed-issues.yml
@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'vitest-dev/vitest'
runs-on: ubuntu-latest
steps:
- - uses: dessant/lock-threads@v4
+ - uses: dessant/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-inactive-days: '14'
From 626c5f8a371cab7757adf4dd44c7786f9d1a00b5 Mon Sep 17 00:00:00 2001
From: Vladimir Sheremet
Date: Thu, 8 Feb 2024 11:28:04 +0100
Subject: [PATCH 09/16] chore(deps): remove npm-run-all2
---
package.json | 1 -
pnpm-lock.yaml | 147 ++++++++++++++++++++++++++++---------------------
2 files changed, 83 insertions(+), 65 deletions(-)
diff --git a/package.json b/package.json
index c1501075bd74..a9e4824f0972 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,6 @@
"fast-glob": "^3.3.2",
"lint-staged": "^15.1.0",
"magic-string": "^0.30.5",
- "npm-run-all2": "^6.1.2",
"pathe": "^1.1.1",
"rimraf": "^5.0.5",
"rollup": "^4.9.6",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 30ef2c78a1d9..ef104bbb20c9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -72,9 +72,6 @@ importers:
magic-string:
specifier: ^0.30.5
version: 0.30.5
- npm-run-all2:
- specifier: ^6.1.2
- version: 6.1.2
pathe:
specifier: ^1.1.1
version: 1.1.1
@@ -104,7 +101,7 @@ importers:
version: 5.2.2
vite:
specifier: ^5.0.12
- version: 5.0.12(@types/node@20.11.5)(less@4.1.3)
+ version: 5.0.12(@types/node@20.11.5)
vitest:
specifier: workspace:*
version: link:packages/vitest
@@ -5533,7 +5530,7 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
espree: 9.6.1
globals: 13.23.0
ignore: 5.2.4
@@ -5604,7 +5601,7 @@ packages:
engines: {node: '>=10.10.0'}
dependencies:
'@humanwhocodes/object-schema': 2.0.1
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@@ -9711,7 +9708,7 @@ packages:
'@typescript-eslint/type-utils': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
'@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
eslint: 8.54.0
graphemer: 1.4.0
ignore: 5.2.4
@@ -9737,7 +9734,7 @@ packages:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2)
'@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
eslint: 8.54.0
typescript: 5.2.2
transitivePeerDependencies:
@@ -9772,7 +9769,7 @@ packages:
dependencies:
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
eslint: 8.54.0
ts-api-utils: 1.0.3(typescript@5.2.2)
typescript: 5.2.2
@@ -9801,7 +9798,7 @@ packages:
dependencies:
'@typescript-eslint/types': 6.10.0
'@typescript-eslint/visitor-keys': 6.10.0
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
@@ -9822,7 +9819,7 @@ packages:
dependencies:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.3
@@ -11316,7 +11313,7 @@ packages:
resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==}
engines: {node: '>= 14'}
dependencies:
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: true
@@ -11474,6 +11471,7 @@ packages:
/ansi-styles@3.2.1:
resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
engines: {node: '>=4'}
+ requiresBuild: true
dependencies:
color-convert: 1.9.3
@@ -12791,6 +12789,7 @@ packages:
/chalk@2.4.2:
resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
engines: {node: '>=4'}
+ requiresBuild: true
dependencies:
ansi-styles: 3.2.1
escape-string-regexp: 1.0.5
@@ -13943,6 +13942,17 @@ packages:
ms: 2.0.0
dev: true
+ /debug@3.2.7:
+ resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+ dependencies:
+ ms: 2.1.3
+ dev: true
+
/debug@3.2.7(supports-color@8.1.1):
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
@@ -13954,6 +13964,18 @@ packages:
ms: 2.1.3
supports-color: 8.1.1
+ /debug@4.3.4:
+ resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
+ engines: {node: '>=6.0'}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+ dependencies:
+ ms: 2.1.2
+ dev: true
+
/debug@4.3.4(supports-color@8.1.1):
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'}
@@ -15128,7 +15150,7 @@ packages:
/eslint-import-resolver-node@0.3.9:
resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
dependencies:
- debug: 3.2.7(supports-color@8.1.1)
+ debug: 3.2.7
is-core-module: 2.13.0
resolve: 1.22.8
transitivePeerDependencies:
@@ -15157,7 +15179,7 @@ packages:
optional: true
dependencies:
'@typescript-eslint/parser': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
- debug: 3.2.7(supports-color@8.1.1)
+ debug: 3.2.7
eslint: 8.54.0
eslint-import-resolver-node: 0.3.9
transitivePeerDependencies:
@@ -15200,7 +15222,7 @@ packages:
peerDependencies:
eslint: ^7.2.0 || ^8
dependencies:
- debug: 3.2.7(supports-color@8.1.1)
+ debug: 3.2.7
doctrine: 2.1.0
eslint: 8.54.0
eslint-import-resolver-node: 0.3.9
@@ -15226,7 +15248,7 @@ packages:
'@es-joy/jsdoccomment': 0.41.0
are-docs-informative: 0.0.2
comment-parser: 1.4.1
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
escape-string-regexp: 4.0.0
eslint: 8.54.0
esquery: 1.5.0
@@ -15398,7 +15420,7 @@ packages:
peerDependencies:
eslint: '>=6.0.0'
dependencies:
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
eslint: 8.54.0
eslint-compat-utils: 0.1.2(eslint@8.54.0)
lodash: 4.17.21
@@ -15520,7 +15542,7 @@ packages:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
@@ -17574,7 +17596,7 @@ packages:
engines: {node: '>= 14'}
dependencies:
agent-base: 7.1.0
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
transitivePeerDependencies:
- supports-color
dev: true
@@ -19051,6 +19073,7 @@ packages:
/js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+ requiresBuild: true
/js-tokens@8.0.2:
resolution: {integrity: sha512-Olnt+V7xYdvGze9YTbGFZIfQXuGV4R3nQwwl8BrtgaPE/wq8UFpUHWuTNc05saowhSr1ZO6tx+V6RjE9D5YQog==}
@@ -19311,11 +19334,6 @@ packages:
/json-parse-even-better-errors@2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
- /json-parse-even-better-errors@3.0.1:
- resolution: {integrity: sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==}
- engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
- dev: true
-
/json-schema-traverse@0.4.1:
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
dev: true
@@ -19571,7 +19589,7 @@ packages:
dependencies:
chalk: 5.3.0
commander: 11.1.0
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
execa: 8.0.1
lilconfig: 2.1.0
listr2: 7.0.2
@@ -20091,11 +20109,6 @@ packages:
readable-stream: 2.3.7
dev: true
- /memorystream@0.3.1:
- resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==}
- engines: {node: '>= 0.10.0'}
- dev: true
-
/meow@3.7.0:
resolution: {integrity: sha512-TNdwZs0skRlpPpCUK25StC4VH+tP5GgeY1HQOOGP+lQ2xtdkN2VtT/5tiX9k3IWpkBPV9b3LsAWXn4GGi/PrSA==}
engines: {node: '>=0.10.0'}
@@ -20144,7 +20157,7 @@ packages:
/micromark@2.11.4:
resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==}
dependencies:
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
parse-entities: 2.0.0
transitivePeerDependencies:
- supports-color
@@ -20839,25 +20852,6 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
- /npm-normalize-package-bin@3.0.1:
- resolution: {integrity: sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==}
- engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
- dev: true
-
- /npm-run-all2@6.1.2:
- resolution: {integrity: sha512-WwwnS8Ft+RpXve6T2EIEVpFLSqN+ORHRvgNk3H9N62SZXjmzKoRhMFg3I17TK3oMaAEr+XFbRirWS2Fn3BCPSg==}
- engines: {node: ^14.18.0 || >=16.0.0, npm: '>= 8'}
- hasBin: true
- dependencies:
- ansi-styles: 6.2.1
- cross-spawn: 7.0.3
- memorystream: 0.3.1
- minimatch: 9.0.3
- pidtree: 0.6.0
- read-package-json-fast: 3.0.2
- shell-quote: 1.7.4
- dev: true
-
/npm-run-path@2.0.2:
resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==}
engines: {node: '>=4'}
@@ -22533,14 +22527,6 @@ packages:
dependencies:
loose-envify: 1.4.0
- /read-package-json-fast@3.0.2:
- resolution: {integrity: sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==}
- engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
- dependencies:
- json-parse-even-better-errors: 3.0.1
- npm-normalize-package-bin: 3.0.1
- dev: true
-
/read-pkg-up@1.0.1:
resolution: {integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==}
engines: {node: '>=0.10.0'}
@@ -23118,7 +23104,7 @@ packages:
rollup: ^4.9.6
dependencies:
'@rollup/pluginutils': 5.0.5(rollup@4.9.6)
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
es-module-lexer: 1.3.1
esbuild: 0.19.11
get-tsconfig: 4.7.2
@@ -23626,10 +23612,6 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
- /shell-quote@1.7.4:
- resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==}
- dev: true
-
/shikiji-core@0.9.17:
resolution: {integrity: sha512-r1FWTXk6SO2aYqfWgcsJ11MuVQ1ymPSdXzJjK7q8EXuyqu8yc2N5qrQy5+BL6gTVOaF4yLjbxFjF+KTRM1Sp8Q==}
dev: true
@@ -24443,6 +24425,7 @@ packages:
/supports-color@5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
engines: {node: '>=4'}
+ requiresBuild: true
dependencies:
has-flag: 3.0.0
@@ -25980,6 +25963,42 @@ packages:
- supports-color
dev: true
+ /vite@5.0.12(@types/node@20.11.5):
+ resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+ hasBin: true
+ peerDependencies:
+ '@types/node': ^18.0.0 || >=20.0.0
+ less: '*'
+ lightningcss: ^1.21.0
+ sass: '*'
+ stylus: '*'
+ sugarss: '*'
+ terser: ^5.4.0
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+ less:
+ optional: true
+ lightningcss:
+ optional: true
+ sass:
+ optional: true
+ stylus:
+ optional: true
+ sugarss:
+ optional: true
+ terser:
+ optional: true
+ dependencies:
+ '@types/node': 20.11.5
+ esbuild: 0.19.11
+ postcss: 8.4.32
+ rollup: 4.9.6
+ optionalDependencies:
+ fsevents: 2.3.3
+ dev: true
+
/vite@5.0.12(@types/node@20.11.5)(less@4.1.3):
resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -26197,7 +26216,7 @@ packages:
peerDependencies:
eslint: '>=6.0.0'
dependencies:
- debug: 4.3.4(supports-color@8.1.1)
+ debug: 4.3.4
eslint: 8.54.0
eslint-scope: 7.2.2
eslint-visitor-keys: 3.4.3
From 29f1f799455c6da2f2e41122e6273952ff3fc873 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 8 Feb 2024 11:33:23 +0100
Subject: [PATCH 10/16] chore(deps): update dependency floating-vue to v5
(#5148)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
packages/ui/package.json | 2 +-
pnpm-lock.yaml | 30 ++++++++++++++++++++----------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 6864fc88ea25..b7189664703f 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -77,7 +77,7 @@
"codemirror-theme-vars": "^0.1.2",
"cypress": "^13.6.2",
"d3-graph-controller": "^3.0.4",
- "floating-vue": "^2.0.0-y.0",
+ "floating-vue": "^5.2.2",
"splitpanes": "^3.1.5",
"unocss": "^0.57.4",
"unplugin-auto-import": "^0.16.7",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ef104bbb20c9..0aa5d7af192e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1209,8 +1209,8 @@ importers:
specifier: ^3.0.4
version: 3.0.4
floating-vue:
- specifier: ^2.0.0-y.0
- version: 2.0.0-y.0(vue@3.3.8)
+ specifier: ^5.2.2
+ version: 5.2.2(vue@3.3.8)
splitpanes:
specifier: ^3.1.5
version: 3.1.5
@@ -5574,14 +5574,20 @@ packages:
fast-json-stringify: 5.2.0
dev: true
- /@floating-ui/core@0.3.1:
- resolution: {integrity: sha512-ensKY7Ub59u16qsVIFEo2hwTCqZ/r9oZZFh51ivcLGHfUwTn8l1Xzng8RJUe91H/UP8PeqeBronAGx0qmzwk2g==}
+ /@floating-ui/core@1.6.0:
+ resolution: {integrity: sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==}
+ dependencies:
+ '@floating-ui/utils': 0.2.1
dev: true
- /@floating-ui/dom@0.1.10:
- resolution: {integrity: sha512-4kAVoogvQm2N0XE0G6APQJuCNuErjOfPW8Ux7DFxh8+AfugWflwVJ5LDlHOwrwut7z/30NUvdtHzQ3zSip4EzQ==}
+ /@floating-ui/dom@1.1.1:
+ resolution: {integrity: sha512-TpIO93+DIujg3g7SykEAGZMDtbJRrmnYRCNYSjJlvIbGhBjRSNTLVbNeDQBrzy9qDgUbiWdc7KA0uZHZ2tJmiw==}
dependencies:
- '@floating-ui/core': 0.3.1
+ '@floating-ui/core': 1.6.0
+ dev: true
+
+ /@floating-ui/utils@0.2.1:
+ resolution: {integrity: sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==}
dev: true
/@gar/promisify@1.1.3:
@@ -16285,12 +16291,16 @@ packages:
/flatted@3.2.9:
resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}
- /floating-vue@2.0.0-y.0(vue@3.3.8):
- resolution: {integrity: sha512-UpJquQIlP0Z5978RYwGN3qsE6jhxxCt7ltzE1mV2m9GwsZ6y7IaIOAszWqALC+OqWhdPad/0GYxoQYGLC0y+Ow==}
+ /floating-vue@5.2.2(vue@3.3.8):
+ resolution: {integrity: sha512-afW+h2CFafo+7Y9Lvw/xsqjaQlKLdJV7h1fCHfcYQ1C4SVMlu7OAekqWgu5d4SgvkBVU0pVpLlVsrSTBURFRkg==}
peerDependencies:
+ '@nuxt/kit': ^3.2.0
vue: ^3.2.0
+ peerDependenciesMeta:
+ '@nuxt/kit':
+ optional: true
dependencies:
- '@floating-ui/dom': 0.1.10
+ '@floating-ui/dom': 1.1.1
vue: 3.3.8(typescript@5.2.2)
vue-resize: 2.0.0-alpha.1(vue@3.3.8)
dev: true
From d70157a1d12c3329188fd3efc0e659628e77c86b Mon Sep 17 00:00:00 2001
From: Vladimir Sheremet
Date: Thu, 8 Feb 2024 11:45:56 +0100
Subject: [PATCH 11/16] ci: enable --reporter-hide-prefix flag
---
package.json | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index a9e4824f0972..00c370598a73 100644
--- a/package.json
+++ b/package.json
@@ -26,9 +26,9 @@
"test": "vitest --api -r test/core",
"test:run": "vitest run -r test/core",
"test:all": "CI=true pnpm -r --stream run test --allowOnly",
- "test:ci": "CI=true pnpm -r --stream --filter !test-browser --filter !test-esm --filter !test-browser run test --allowOnly",
- "test:ci:vm-threads": "CI=true pnpm -r --stream --filter !test-coverage --filter !test-single-thread --filter !test-browser --filter !test-esm --filter !test-network-imports --filter !test-browser --filter !example-react-testing-lib-msw run test --allowOnly --pool vmThreads",
- "test:ci:no-threads": "CI=true pnpm -r --stream --filter !test-vm-threads --filter !test-coverage --filter !test-watch --filter !test-bail --filter !test-esm --filter !test-browser run test --allowOnly --pool forks",
+ "test:ci": "CI=true pnpm -r --reporter-hide-prefix --stream --filter !test-browser --filter !test-esm --filter !test-browser run test --allowOnly",
+ "test:ci:vm-threads": "CI=true pnpm -r --reporter-hide-prefix --stream --filter !test-coverage --filter !test-single-thread --filter !test-browser --filter !test-esm --filter !test-network-imports --filter !test-browser --filter !example-react-testing-lib-msw run test --allowOnly --pool vmThreads",
+ "test:ci:no-threads": "CI=true pnpm -r --reporter-hide-prefix --stream --filter !test-vm-threads --filter !test-coverage --filter !test-watch --filter !test-bail --filter !test-esm --filter !test-browser run test --allowOnly --pool forks",
"typecheck": "tsc -p tsconfig.check.json --noEmit",
"typecheck:why": "tsc -p tsconfig.check.json --noEmit --explainFiles > explainTypes.txt",
"ui:build": "vite build packages/ui",
@@ -55,6 +55,7 @@
"fast-glob": "^3.3.2",
"lint-staged": "^15.1.0",
"magic-string": "^0.30.5",
+ "npm-run-all2": "^5.0.0",
"pathe": "^1.1.1",
"rimraf": "^5.0.5",
"rollup": "^4.9.6",
From 219d763ca3d1f056e961d1790474d3834f1fcc6b Mon Sep 17 00:00:00 2001
From: Vladimir Sheremet
Date: Thu, 8 Feb 2024 13:47:42 +0100
Subject: [PATCH 12/16] chore: fix lockfile
---
package.json | 1 -
pnpm-lock.yaml | 99 ++++++++++----------------------------------------
2 files changed, 20 insertions(+), 80 deletions(-)
diff --git a/package.json b/package.json
index 00c370598a73..b45f7f37abac 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,6 @@
"fast-glob": "^3.3.2",
"lint-staged": "^15.1.0",
"magic-string": "^0.30.5",
- "npm-run-all2": "^5.0.0",
"pathe": "^1.1.1",
"rimraf": "^5.0.5",
"rollup": "^4.9.6",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0aa5d7af192e..bff288679e02 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -101,7 +101,7 @@ importers:
version: 5.2.2
vite:
specifier: ^5.0.12
- version: 5.0.12(@types/node@20.11.5)
+ version: 5.0.12(@types/node@20.11.5)(less@4.1.3)
vitest:
specifier: workspace:*
version: link:packages/vitest
@@ -5530,7 +5530,7 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
espree: 9.6.1
globals: 13.23.0
ignore: 5.2.4
@@ -5607,7 +5607,7 @@ packages:
engines: {node: '>=10.10.0'}
dependencies:
'@humanwhocodes/object-schema': 2.0.1
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@@ -9714,7 +9714,7 @@ packages:
'@typescript-eslint/type-utils': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
'@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
eslint: 8.54.0
graphemer: 1.4.0
ignore: 5.2.4
@@ -9740,7 +9740,7 @@ packages:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2)
'@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
eslint: 8.54.0
typescript: 5.2.2
transitivePeerDependencies:
@@ -9775,7 +9775,7 @@ packages:
dependencies:
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.2.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
eslint: 8.54.0
ts-api-utils: 1.0.3(typescript@5.2.2)
typescript: 5.2.2
@@ -9804,7 +9804,7 @@ packages:
dependencies:
'@typescript-eslint/types': 6.10.0
'@typescript-eslint/visitor-keys': 6.10.0
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
@@ -9825,7 +9825,7 @@ packages:
dependencies:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/visitor-keys': 6.21.0
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.3
@@ -11319,7 +11319,7 @@ packages:
resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==}
engines: {node: '>= 14'}
dependencies:
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
dev: true
@@ -13948,17 +13948,6 @@ packages:
ms: 2.0.0
dev: true
- /debug@3.2.7:
- resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
- peerDependencies:
- supports-color: '*'
- peerDependenciesMeta:
- supports-color:
- optional: true
- dependencies:
- ms: 2.1.3
- dev: true
-
/debug@3.2.7(supports-color@8.1.1):
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
@@ -13970,18 +13959,6 @@ packages:
ms: 2.1.3
supports-color: 8.1.1
- /debug@4.3.4:
- resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
- engines: {node: '>=6.0'}
- peerDependencies:
- supports-color: '*'
- peerDependenciesMeta:
- supports-color:
- optional: true
- dependencies:
- ms: 2.1.2
- dev: true
-
/debug@4.3.4(supports-color@8.1.1):
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
engines: {node: '>=6.0'}
@@ -15156,7 +15133,7 @@ packages:
/eslint-import-resolver-node@0.3.9:
resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
dependencies:
- debug: 3.2.7
+ debug: 3.2.7(supports-color@8.1.1)
is-core-module: 2.13.0
resolve: 1.22.8
transitivePeerDependencies:
@@ -15185,7 +15162,7 @@ packages:
optional: true
dependencies:
'@typescript-eslint/parser': 6.21.0(eslint@8.54.0)(typescript@5.2.2)
- debug: 3.2.7
+ debug: 3.2.7(supports-color@8.1.1)
eslint: 8.54.0
eslint-import-resolver-node: 0.3.9
transitivePeerDependencies:
@@ -15228,7 +15205,7 @@ packages:
peerDependencies:
eslint: ^7.2.0 || ^8
dependencies:
- debug: 3.2.7
+ debug: 3.2.7(supports-color@8.1.1)
doctrine: 2.1.0
eslint: 8.54.0
eslint-import-resolver-node: 0.3.9
@@ -15254,7 +15231,7 @@ packages:
'@es-joy/jsdoccomment': 0.41.0
are-docs-informative: 0.0.2
comment-parser: 1.4.1
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
escape-string-regexp: 4.0.0
eslint: 8.54.0
esquery: 1.5.0
@@ -15426,7 +15403,7 @@ packages:
peerDependencies:
eslint: '>=6.0.0'
dependencies:
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
eslint: 8.54.0
eslint-compat-utils: 0.1.2(eslint@8.54.0)
lodash: 4.17.21
@@ -15548,7 +15525,7 @@ packages:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.3
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
@@ -17606,7 +17583,7 @@ packages:
engines: {node: '>= 14'}
dependencies:
agent-base: 7.1.0
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
transitivePeerDependencies:
- supports-color
dev: true
@@ -19599,7 +19576,7 @@ packages:
dependencies:
chalk: 5.3.0
commander: 11.1.0
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
execa: 8.0.1
lilconfig: 2.1.0
listr2: 7.0.2
@@ -20167,7 +20144,7 @@ packages:
/micromark@2.11.4:
resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==}
dependencies:
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
parse-entities: 2.0.0
transitivePeerDependencies:
- supports-color
@@ -23114,7 +23091,7 @@ packages:
rollup: ^4.9.6
dependencies:
'@rollup/pluginutils': 5.0.5(rollup@4.9.6)
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
es-module-lexer: 1.3.1
esbuild: 0.19.11
get-tsconfig: 4.7.2
@@ -25973,42 +25950,6 @@ packages:
- supports-color
dev: true
- /vite@5.0.12(@types/node@20.11.5):
- resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==}
- engines: {node: ^18.0.0 || >=20.0.0}
- hasBin: true
- peerDependencies:
- '@types/node': ^18.0.0 || >=20.0.0
- less: '*'
- lightningcss: ^1.21.0
- sass: '*'
- stylus: '*'
- sugarss: '*'
- terser: ^5.4.0
- peerDependenciesMeta:
- '@types/node':
- optional: true
- less:
- optional: true
- lightningcss:
- optional: true
- sass:
- optional: true
- stylus:
- optional: true
- sugarss:
- optional: true
- terser:
- optional: true
- dependencies:
- '@types/node': 20.11.5
- esbuild: 0.19.11
- postcss: 8.4.32
- rollup: 4.9.6
- optionalDependencies:
- fsevents: 2.3.3
- dev: true
-
/vite@5.0.12(@types/node@20.11.5)(less@4.1.3):
resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -26226,7 +26167,7 @@ packages:
peerDependencies:
eslint: '>=6.0.0'
dependencies:
- debug: 4.3.4
+ debug: 4.3.4(supports-color@8.1.1)
eslint: 8.54.0
eslint-scope: 7.2.2
eslint-visitor-keys: 3.4.3
From 567d20b99fb1db0ebcc86a49b3bebd9fd7511aae Mon Sep 17 00:00:00 2001
From: Vladimir
Date: Thu, 8 Feb 2024 15:03:17 +0100
Subject: [PATCH 13/16] feat(vitest): expose jsdom global if jsdom environment
is enabled (#5155)
---
docs/config/index.md | 4 ++++
packages/vitest/src/integrations/env/jsdom.ts | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/docs/config/index.md b/docs/config/index.md
index d0206a66699e..e2690c3d499a 100644
--- a/docs/config/index.md
+++ b/docs/config/index.md
@@ -511,6 +511,10 @@ export default {
Vitest also exposes `builtinEnvironments` through `vitest/environments` entry, in case you just want to extend it. You can read more about extending environments in [our guide](/guide/environment).
+::: tip
+Since Vitest 1.3.0 jsdom environment exposes `jsdom` global variable equal to the current [JSDOM](https://github.com/jsdom/jsdom) instance.
+:::
+
### environmentOptions
- **Type:** `Record<'jsdom' | string, unknown>`
diff --git a/packages/vitest/src/integrations/env/jsdom.ts b/packages/vitest/src/integrations/env/jsdom.ts
index 7141e95b60d9..0b509072a7f0 100644
--- a/packages/vitest/src/integrations/env/jsdom.ts
+++ b/packages/vitest/src/integrations/env/jsdom.ts
@@ -67,6 +67,7 @@ export default ({
// TODO: browser doesn't expose Buffer, but a lot of dependencies use it
dom.window.Buffer = Buffer
+ dom.window.jsdom = dom
// inject web globals if they missing in JSDOM but otherwise available in Nodejs
// https://nodejs.org/dist/latest/docs/api/globals.html
@@ -141,10 +142,13 @@ export default ({
const clearWindowErrors = catchWindowErrors(global)
+ global.jsdom = dom
+
return {
teardown(global) {
clearWindowErrors()
dom.window.close()
+ delete global.jsdom
keys.forEach(key => delete global[key])
originals.forEach((v, k) => global[k] = v)
},
From a931646fb9f030365503da75a23cc5afb8db68e5 Mon Sep 17 00:00:00 2001
From: Vladimir
Date: Thu, 8 Feb 2024 16:48:44 +0100
Subject: [PATCH 14/16] refactor: add CLI config schema to make sure we don't
miss options (#5126)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Ari Perkkiƶ
Co-authored-by: Lorenzo Bloedow
---
.github/renovate.json5 | 1 +
eslint.config.js | 2 +
package.json | 3 +-
packages/vitest/LICENSE.md | 29 +
packages/vitest/package.json | 2 +-
packages/vitest/rollup.config.js | 2 +-
packages/vitest/src/node/cache/index.ts | 2 +-
packages/vitest/src/node/cli.ts | 208 +------
packages/vitest/src/node/cli/cac.ts | 221 +++++++
packages/vitest/src/node/{ => cli}/cli-api.ts | 43 +-
packages/vitest/src/node/cli/cli-config.ts | 551 ++++++++++++++++++
.../vitest/src/node/{ => cli}/cli-wrapper.ts | 4 +-
packages/vitest/src/node/index.ts | 2 +-
packages/vitest/src/types/pool-options.ts | 8 +-
patches/cac@6.7.14.patch | 101 ++++
pnpm-lock.yaml | 20 +-
test/config/fixtures/test/log-output.test.ts | 19 -
test/config/test/failures.test.ts | 14 -
test/config/test/options.test.ts | 25 -
test/core/test/cli-test.test.ts | 121 ++++
20 files changed, 1069 insertions(+), 309 deletions(-)
create mode 100644 packages/vitest/src/node/cli/cac.ts
rename packages/vitest/src/node/{ => cli}/cli-api.ts (69%)
create mode 100644 packages/vitest/src/node/cli/cli-config.ts
rename packages/vitest/src/node/{ => cli}/cli-wrapper.ts (97%)
create mode 100644 patches/cac@6.7.14.patch
delete mode 100644 test/config/fixtures/test/log-output.test.ts
delete mode 100644 test/config/test/options.test.ts
create mode 100644 test/core/test/cli-test.test.ts
diff --git a/.github/renovate.json5 b/.github/renovate.json5
index cca4e23b1d5c..293bd36fab95 100644
--- a/.github/renovate.json5
+++ b/.github/renovate.json5
@@ -27,6 +27,7 @@
// we patch these packages
"@types/chai",
"@sinonjs/fake-timers",
+ "cac",
// TODO: update when chai is updated to 5.0
"loupe",
// Pinned due to https://github.com/vitest-dev/vitest/issues/4710
diff --git a/eslint.config.js b/eslint.config.js
index 493c5cfd2f3f..c23057a4b187 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -25,6 +25,7 @@ export default antfu(
'no-empty-pattern': 'off',
'antfu/indent-binary-ops': 'off',
'style/member-delimiter-style': ['error', { multiline: { delimiter: 'none' }, singleline: { delimiter: 'semi' } }],
+ 'unused-imports/no-unused-imports': 'error',
'ts/no-invalid-this': 'off',
@@ -72,6 +73,7 @@ export default antfu(
'style/max-statements-per-line': 'off',
'import/newline-after-import': 'off',
'import/first': 'off',
+ 'unused-imports/no-unused-imports': 'off',
},
},
{
diff --git a/package.json b/package.json
index b45f7f37abac..df4106b8edb4 100644
--- a/package.json
+++ b/package.json
@@ -80,7 +80,8 @@
},
"patchedDependencies": {
"@types/chai@4.3.6": "patches/@types__chai@4.3.6.patch",
- "@sinonjs/fake-timers@11.1.0": "patches/@sinonjs__fake-timers@11.1.0.patch"
+ "@sinonjs/fake-timers@11.1.0": "patches/@sinonjs__fake-timers@11.1.0.patch",
+ "cac@6.7.14": "patches/cac@6.7.14.patch"
}
},
"simple-git-hooks": {
diff --git a/packages/vitest/LICENSE.md b/packages/vitest/LICENSE.md
index 416122e92275..489e43810be9 100644
--- a/packages/vitest/LICENSE.md
+++ b/packages/vitest/LICENSE.md
@@ -306,6 +306,35 @@ Repository: micromatch/braces
---------------------------------------
+## cac
+License: MIT
+By: egoist
+Repository: egoist/cac
+
+> The MIT License (MIT)
+>
+> Copyright (c) EGOIST <0x142857@gmail.com> (https://github.com/egoist)
+>
+> Permission is hereby granted, free of charge, to any person obtaining a copy
+> of this software and associated documentation files (the "Software"), to deal
+> in the Software without restriction, including without limitation the rights
+> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+> copies of the Software, and to permit persons to whom the Software is
+> furnished to do so, subject to the following conditions:
+>
+> The above copyright notice and this permission notice shall be included in
+> all copies or substantial portions of the Software.
+>
+> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+> THE SOFTWARE.
+
+---------------------------------------
+
## chai-subset
License: MIT
By: Andrii Shumada, Robert Herhold
diff --git a/packages/vitest/package.json b/packages/vitest/package.json
index 2d8c6eac46c0..8abd6af8b062 100644
--- a/packages/vitest/package.json
+++ b/packages/vitest/package.json
@@ -147,7 +147,6 @@
"@vitest/spy": "workspace:*",
"@vitest/utils": "workspace:*",
"acorn-walk": "^8.3.2",
- "cac": "^6.7.14",
"chai": "^4.3.10",
"debug": "^4.3.4",
"execa": "^8.0.1",
@@ -177,6 +176,7 @@
"@types/prompts": "^2.4.9",
"@types/sinonjs__fake-timers": "^8.1.5",
"birpc": "0.2.15",
+ "cac": "^6.7.14",
"chai-subset": "^1.6.0",
"cli-truncate": "^4.0.0",
"expect-type": "^0.17.3",
diff --git a/packages/vitest/rollup.config.js b/packages/vitest/rollup.config.js
index 3c2d04caebf5..c5542c49a153 100644
--- a/packages/vitest/rollup.config.js
+++ b/packages/vitest/rollup.config.js
@@ -19,7 +19,7 @@ const entries = {
'path': 'src/paths.ts',
'index': 'src/index.ts',
'cli': 'src/node/cli.ts',
- 'cli-wrapper': 'src/node/cli-wrapper.ts',
+ 'cli-wrapper': 'src/node/cli/cli-wrapper.ts',
'node': 'src/node.ts',
'suite': 'src/suite.ts',
'browser': 'src/browser.ts',
diff --git a/packages/vitest/src/node/cache/index.ts b/packages/vitest/src/node/cache/index.ts
index a63c2ef5d8cf..6783736ba23a 100644
--- a/packages/vitest/src/node/cache/index.ts
+++ b/packages/vitest/src/node/cache/index.ts
@@ -4,7 +4,7 @@ import { findUp } from 'find-up'
import { resolve } from 'pathe'
import { loadConfigFromFile } from 'vite'
import { configFiles } from '../../constants'
-import type { CliOptions } from '../cli-api'
+import type { CliOptions } from '../cli/cli-api'
import { slash } from '../../utils'
import { FilesStatsCache } from './files'
import { ResultsCache } from './results'
diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts
index a03dfdba6557..6b181737ca8f 100644
--- a/packages/vitest/src/node/cli.ts
+++ b/packages/vitest/src/node/cli.ts
@@ -1,207 +1,3 @@
-import { normalize } from 'pathe'
-import cac from 'cac'
-import c from 'picocolors'
-import { version } from '../../package.json'
-import { toArray } from '../utils'
-import type { BaseCoverageOptions, CoverageIstanbulOptions, Vitest, VitestRunMode } from '../types'
-import type { CliOptions } from './cli-api'
-import { startVitest } from './cli-api'
-import { divider } from './reporters/renderers/utils'
+import { createCLI } from './cli/cac'
-const cli = cac('vitest')
-
-cli
- .version(version)
- .option('-r, --root ', 'Root path')
- .option('-c, --config ', 'Path to config file')
- .option('-u, --update', 'Update snapshot')
- .option('-w, --watch', 'Enable watch mode')
- .option('-t, --testNamePattern ', 'Run tests with full names matching the specified regexp pattern')
- .option('--dir ', 'Base directory to scan for the test files')
- .option('--ui', 'Enable UI')
- .option('--open', 'Open UI automatically (default: !process.env.CI))')
- .option('--api [api]', 'Serve API, available options: --api.port , --api.host [host] and --api.strictPort')
- .option('--silent', 'Silent console output from tests')
- .option('--hideSkippedTests', 'Hide logs for skipped tests')
- .option('--reporter ', 'Specify reporters')
- .option('--outputFile ', 'Write test results to a file when supporter reporter is also specified, use cac\'s dot notation for individual outputs of multiple reporters')
- .option('--coverage', 'Enable coverage report')
- .option('--coverage.all', 'Whether to include all files, including the untested ones into report', { default: true })
- .option('--run', 'Disable watch mode')
- .option('--mode ', 'Override Vite mode (default: test)')
- .option('--workspace ', 'Path to a workspace configuration file')
- .option('--isolate', 'Run every test file in isolation. To disable isolation, use --no-isolate (default: true)')
- .option('--globals', 'Inject apis globally')
- .option('--dom', 'Mock browser API with happy-dom')
- .option('--browser [options]', 'Run tests in the browser (default: false)')
- .option('--pool ', 'Specify pool, if not running in the browser (default: threads)')
- .option('--poolOptions ', 'Specify pool options')
- .option('--poolOptions.threads.isolate', 'Isolate tests in threads pool (default: true)')
- .option('--poolOptions.forks.isolate', 'Isolate tests in forks pool (default: true)')
- .option('--fileParallelism', 'Should all test files run in parallel. Use --no-file-parallelism to disable (default: true)')
- .option('--maxWorkers ', 'Maximum number of workers to run tests in')
- .option('--minWorkers ', 'Minimum number of workers to run tests in')
- .option('--environment ', 'Specify runner environment, if not running in the browser (default: node)')
- .option('--passWithNoTests', 'Pass when no tests found')
- .option('--logHeapUsage', 'Show the size of heap for each test')
- .option('--allowOnly', 'Allow tests and suites that are marked as only (default: !process.env.CI)')
- .option('--dangerouslyIgnoreUnhandledErrors', 'Ignore any unhandled errors that occur')
- .option('--shard ', 'Test suite shard to execute in a format of /')
- .option('--changed [since]', 'Run tests that are affected by the changed files (default: false)')
- .option('--sequence ', 'Define in what order to run tests (use --sequence.shuffle to run tests in random order, use --sequence.concurrent to run tests in parallel)')
- .option('--segfaultRetry ', 'Return tests on segment fault (default: 0)', { default: 0 })
- .option('--no-color', 'Removes colors from the console output')
- .option('--inspect', 'Enable Node.js inspector')
- .option('--inspect-brk', 'Enable Node.js inspector with break')
- .option('--test-timeout
-
@@ -49,7 +48,6 @@ Next generation testing framework powered by Vite.
> Vitest 1.0 requires Vite >=v5.0.0 and Node >=v18.0.0
-
```ts
import { assert, describe, expect, it } from 'vitest'
diff --git a/docs/advanced/runner.md b/docs/advanced/runner.md
index c841ee035600..da8bf1a99d1e 100644
--- a/docs/advanced/runner.md
+++ b/docs/advanced/runner.md
@@ -11,69 +11,69 @@ export interface VitestRunner {
/**
* First thing that's getting called before actually collecting and running tests.
*/
- onBeforeCollect?(paths: string[]): unknown
+ onBeforeCollect?: (paths: string[]) => unknown
/**
* Called after collecting tests and before "onBeforeRun".
*/
- onCollected?(files: File[]): unknown
+ onCollected?: (files: File[]) => unknown
/**
* Called when test runner should cancel next test runs.
* Runner should listen for this method and mark tests and suites as skipped in
* "onBeforeRunSuite" and "onBeforeRunTask" when called.
*/
- onCancel?(reason: CancelReason): unknown
+ onCancel?: (reason: CancelReason) => unknown
/**
* Called before running a single test. Doesn't have "result" yet.
*/
- onBeforeRunTask?(test: TaskPopulated): unknown
+ onBeforeRunTask?: (test: TaskPopulated) => unknown
/**
* Called before actually running the test function. Already has "result" with "state" and "startTime".
*/
- onBeforeTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
+ onBeforeTryTask?: (test: TaskPopulated, options: { retry: number; repeats: number }) => unknown
/**
* Called after result and state are set.
*/
- onAfterRunTask?(test: TaskPopulated): unknown
+ onAfterRunTask?: (test: TaskPopulated) => unknown
/**
* Called right after running the test function. Doesn't have new state yet. Will not be called, if the test function throws.
*/
- onAfterTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
+ onAfterTryTask?: (test: TaskPopulated, options: { retry: number; repeats: number }) => unknown
/**
* Called before running a single suite. Doesn't have "result" yet.
*/
- onBeforeRunSuite?(suite: Suite): unknown
+ onBeforeRunSuite?: (suite: Suite) => unknown
/**
* Called after running a single suite. Has state and result.
*/
- onAfterRunSuite?(suite: Suite): unknown
+ onAfterRunSuite?: (suite: Suite) => unknown
/**
* If defined, will be called instead of usual Vitest suite partition and handling.
* "before" and "after" hooks will not be ignored.
*/
- runSuite?(suite: Suite): Promise
+ runSuite?: (suite: Suite) => Promise
/**
* If defined, will be called instead of usual Vitest handling. Useful, if you have your custom test function.
* "before" and "after" hooks will not be ignored.
*/
- runTask?(test: TaskPopulated): Promise
+ runTask?: (test: TaskPopulated) => Promise
/**
* Called, when a task is updated. The same as "onTaskUpdate" in a reporter, but this is running in the same thread as tests.
*/
- onTaskUpdate?(task: [string, TaskResult | undefined][]): Promise
+ onTaskUpdate?: (task: [string, TaskResult | undefined][]) => Promise
/**
* Called before running all tests in collected paths.
*/
- onBeforeRunFiles?(files: File[]): unknown
+ onBeforeRunFiles?: (files: File[]) => unknown
/**
* Called right after running all tests in collected paths.
*/
- onAfterRunFiles?(files: File[]): unknown
+ onAfterRunFiles?: (files: File[]) => unknown
/**
* Called when new context for a test is defined. Useful, if you want to add custom properties to the context.
* If you only want to define custom context with a runner, consider using "beforeAll" in "setupFiles" instead.
@@ -82,11 +82,11 @@ export interface VitestRunner {
*
* @see https://vitest.dev/advanced/runner.html#your-task-function
*/
- extendTaskContext?(context: TaskContext): TaskContext
+ extendTaskContext?: (context: TaskContext) => TaskContext
/**
* Called, when certain files are imported. Can be called in two situations: when collecting tests and when importing setup files.
*/
- importFile(filepath: string, source: VitestRunnerImportSource): unknown
+ importFile: (filepath: string, source: VitestRunnerImportSource) => unknown
/**
* Publicly available configuration.
*/
diff --git a/docs/api/expect.md b/docs/api/expect.md
index 242251f480a2..5bf3ac2f43d4 100644
--- a/docs/api/expect.md
+++ b/docs/api/expect.md
@@ -1389,7 +1389,7 @@ If you are using TypeScript, since Vitest 0.31.0 you can extend default `Asserti
```ts
interface CustomMatchers {
- toBeFoo(): R
+ toBeFoo: () => R
}
declare module 'vitest' {
@@ -1456,4 +1456,4 @@ expect.addEqualityTesters([areAnagramsEqual])
test('custom equality tester', () => {
expect(new AnagramComparator('listen')).toEqual(new AnagramComparator('silent'))
})
-```
\ No newline at end of file
+```
diff --git a/docs/api/index.md b/docs/api/index.md
index f245730919a4..7df39b39058e 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -209,7 +209,6 @@ test.todo.concurrent(/* ... */) // or test.concurrent.todo(/* ... */)
When running concurrent tests, Snapshots and Assertions must use `expect` from the local [Test Context](/guide/test-context.md) to ensure the right test is detected.
-
```ts
test.concurrent('test 1', async ({ expect }) => {
expect(foo).toMatchSnapshot()
diff --git a/docs/config/index.md b/docs/config/index.md
index e2690c3d499a..cf0c627dc50f 100644
--- a/docs/config/index.md
+++ b/docs/config/index.md
@@ -702,7 +702,6 @@ Minimum number of threads. You can also use `VITEST_MIN_THREADS` environment var
Run all tests with the same environment inside a single worker thread. This will disable built-in module isolation (your source code or [inlined](#deps-inline) code will still be reevaluated for each test), but can improve test performance.
-
:::warning
Even though this option will force tests to run one after another, this option is different from Jest's `--runInBand`. Vitest uses workers not only for running tests in parallel, but also to provide isolation. By disabling this option, your tests will run sequentially, but in the same global context, so you must provide isolation yourself.
@@ -782,7 +781,6 @@ Isolate environment for each test file.
Run all tests with the same environment inside a single child process. This will disable built-in module isolation (your source code or [inlined](#deps-inline) code will still be reevaluated for each test), but can improve test performance.
-
:::warning
Even though this option will force tests to run one after another, this option is different from Jest's `--runInBand`. Vitest uses child processes not only for running tests in parallel, but also to provide isolation. By disabling this option, your tests will run sequentially, but in the same global context, so you must provide isolation yourself.
@@ -881,7 +879,6 @@ Pass additional arguments to `node` process in the VM context. See [Command-line
Be careful when using, it as some options may crash worker, e.g. --prof, --title. See https://github.com/nodejs/node/issues/41103.
:::
-
#### poolOptions.vmForks
Options for `vmForks` pool.
@@ -1063,7 +1060,6 @@ declare module 'vitest' {
```
:::
-
### watchExclude
- **Type:** `string[]`
@@ -1557,10 +1553,10 @@ Path to a provider that will be used when running browser tests. Vitest provides
```ts
export interface BrowserProvider {
name: string
- getSupportedBrowsers(): readonly string[]
- initialize(ctx: Vitest, options: { browser: string; options?: BrowserProviderOptions }): Awaitable
- openPage(url: string): Awaitable
- close(): Awaitable
+ getSupportedBrowsers: () => readonly string[]
+ initialize: (ctx: Vitest, options: { browser: string; options?: BrowserProviderOptions }) => Awaitable
+ openPage: (url: string) => Awaitable
+ close: () => Awaitable
}
```
diff --git a/docs/guide/extending-matchers.md b/docs/guide/extending-matchers.md
index 8e9974339741..82b542ef10b9 100644
--- a/docs/guide/extending-matchers.md
+++ b/docs/guide/extending-matchers.md
@@ -29,7 +29,7 @@ If you are using TypeScript, since Vitest 0.31.0 you can extend default `Asserti
import type { Assertion, AsymmetricMatchersContaining } from 'vitest'
interface CustomMatchers {
- toBeFoo(): R
+ toBeFoo: () => R
}
declare module 'vitest' {
diff --git a/docs/guide/filtering.md b/docs/guide/filtering.md
index d3a5e82fff56..462d3cf95674 100644
--- a/docs/guide/filtering.md
+++ b/docs/guide/filtering.md
@@ -22,7 +22,7 @@ basic-foo.test.ts
basic/foo.test.ts
```
-You can also use the `-t, --testNamePattern ` option to filter tests by full name. This can be helpful when you want to filter by the name defined within a file rather than the filename itself.
+You can also use the `-t, --testNamePattern ` option to filter tests by full name. This can be helpful when you want to filter by the name defined within a file rather than the filename itself.
## Specifying a Timeout
diff --git a/docs/guide/migration.md b/docs/guide/migration.md
index c13233e52a7e..2e82cc8b87aa 100644
--- a/docs/guide/migration.md
+++ b/docs/guide/migration.md
@@ -19,7 +19,6 @@ All `@vitest/*` sub packages require Vitest version 1.0.
Quotes in snapshots are no longer escaped, and all snapshots use backtick quotes (`) even if the string is just a single line.
-
1. Quotes are no longer escaped:
```diff
@@ -44,7 +43,6 @@ There were also [changes](https://github.com/vitest-dev/vitest/pull/4076) to `@v
- `client.setTest` was renamed to `client.startCurrentRun`
- `client.resetCurrent` was renamed to `client.finishCurrentRun`
-
### Pools are Standardized [#4172](https://github.com/vitest-dev/vitest/pull/4172)
We removed a lot of configuration options to make it easier to configure the runner to your needs. Please, have a look at migration examples if you rely on `--threads` or other related flags.
@@ -145,7 +143,6 @@ A few types were removed in favor of Jest-style "Mock" naming.
`SpyInstance` is deprecated in favor of `MockInstance` and will be removed in the next major release.
:::
-
### Timer mocks [#3925](https://github.com/vitest-dev/vitest/pull/3925)
`vi.useFakeTimers()` no longer automatically mocks [`process.nextTick`](https://nodejs.org/api/process.html#processnexttickcallback-args).
diff --git a/docs/guide/mocking.md b/docs/guide/mocking.md
index 87c88e1606af..e40b9b10849f 100644
--- a/docs/guide/mocking.md
+++ b/docs/guide/mocking.md
@@ -362,7 +362,6 @@ Because Vitest runs in Node, mocking network requests is tricky; web APIs are no
Mock Service Worker (MSW) works by intercepting the requests your tests make, allowing you to use it without changing any of your application code. In-browser, this uses the [Service Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API). In Node.js, and for Vitest, it uses the [`@mswjs/interceptors`](https://github.com/mswjs/interceptors) library. To learn more about MSW, read their [introduction](https://mswjs.io/docs/)
-
### Configuration
You can use it like below in your [setup file](/config/#setupfiles)
diff --git a/docs/guide/reporters.md b/docs/guide/reporters.md
index 933602a803a8..699bec9d6435 100644
--- a/docs/guide/reporters.md
+++ b/docs/guide/reporters.md
@@ -426,7 +426,6 @@ not ok 1 - __tests__/test-file-1.test.ts > first test file > 2 + 2 should equal
ok 2 - __tests__/test-file-1.test.ts > first test file > 4 - 2 should equal 2 # time=0.00ms
```
-
### Hanging Process Reporter
Displays a list of hanging processes, if any are preventing Vitest from exiting safely. The `hanging-process` reporter does not itself display test results, but can be used in conjunction with another reporter to monitor processes while tests run. Using this reporter can be resource-intensive, so should generally be reserved for debugging purposes in situations where Vitest consistently cannot exit the process.
@@ -453,8 +452,6 @@ to provide annotations for test failures. This reporter is automatically enabled
-
-
## Custom Reporters
You can use third-party custom reporters installed from NPM by specifying their package name in the reporters' option:
diff --git a/docs/guide/snapshot.md b/docs/guide/snapshot.md
index a91a109349b5..727ad8c99ad8 100644
--- a/docs/guide/snapshot.md
+++ b/docs/guide/snapshot.md
@@ -159,7 +159,6 @@ export default {
} satisfies SnapshotSerializer
```
-
```ts
import { defineConfig } from 'vite'
diff --git a/docs/guide/ui.md b/docs/guide/ui.md
index 49c931190aea..6797091f9753 100644
--- a/docs/guide/ui.md
+++ b/docs/guide/ui.md
@@ -18,7 +18,6 @@ vitest --ui
Then you can visit the Vitest UI at `http://localhost:51204/__vitest__/`
-
diff --git a/eslint.config.js b/eslint.config.js
index c23057a4b187..0525bdb0b49d 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -24,8 +24,14 @@ export default antfu(
'node/prefer-global/process': 'off',
'no-empty-pattern': 'off',
'antfu/indent-binary-ops': 'off',
- 'style/member-delimiter-style': ['error', { multiline: { delimiter: 'none' }, singleline: { delimiter: 'semi' } }],
'unused-imports/no-unused-imports': 'error',
+ 'style/member-delimiter-style': [
+ 'error',
+ {
+ multiline: { delimiter: 'none' },
+ singleline: { delimiter: 'semi' },
+ },
+ ],
'ts/no-invalid-this': 'off',
@@ -42,6 +48,12 @@ export default antfu(
'import/no-named-as-default': 'off',
},
},
+ {
+ files: [`packages/*/*.{js,mjs,d.ts}`],
+ rules: {
+ 'antfu/no-import-dist': 'off',
+ },
+ },
{
files: [`packages/${GLOB_SRC}`],
rules: {
diff --git a/examples/image-snapshot/test/basic.test.ts b/examples/image-snapshot/test/basic.test.ts
index 537c8d1f7fb7..54e35e293793 100644
--- a/examples/image-snapshot/test/basic.test.ts
+++ b/examples/image-snapshot/test/basic.test.ts
@@ -4,7 +4,7 @@ import { toMatchImageSnapshot } from 'jest-image-snapshot'
declare module 'vitest' {
interface Assertion {
- toMatchImageSnapshot(): T
+ toMatchImageSnapshot: () => T
}
}
diff --git a/netlify.toml b/netlify.toml
index 7a1c0873a351..fcf540413470 100755
--- a/netlify.toml
+++ b/netlify.toml
@@ -1,19 +1,20 @@
-[build.environment]
- NODE_VERSION = "20"
- # don't need playwright for docs build
- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"
-
[build]
- publish = "docs/.vitepress/dist"
- command = "pnpm docs:build"
- ignore = "git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- docs/ package.json pnpm-lock.yaml"
+publish = "docs/.vitepress/dist"
+command = "pnpm docs:build"
+ignore = "git diff --quiet $COMMIT_REF $CACHED_COMMIT_REF -- docs/ package.json pnpm-lock.yaml"
+
+[build.environment]
+NODE_VERSION = "20"
+# don't need playwright for docs build
+PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"
[[redirects]]
- from = "/new"
- to = "https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/"
- status = 302
+from = "/new"
+to = "https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/"
+status = 302
[[headers]]
- for = "/manifest.webmanifest"
- [headers.values]
- Content-Type = "application/manifest+json"
+for = "/manifest.webmanifest"
+
+[headers.values]
+Content-Type = "application/manifest+json"
diff --git a/package.json b/package.json
index df4106b8edb4..baed07ecabd6 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,7 @@
"test:browser:playwright": "pnpm -C test/browser run test:playwright"
},
"devDependencies": {
- "@antfu/eslint-config": "^1.2.1",
+ "@antfu/eslint-config": "^2.6.4",
"@antfu/ni": "^0.21.12",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.0.1",
diff --git a/packages/browser/package.json b/packages/browser/package.json
index 478a9c545a11..efeba6c3cd03 100644
--- a/packages/browser/package.json
+++ b/packages/browser/package.json
@@ -55,13 +55,13 @@
"webdriverio": "*"
},
"peerDependenciesMeta": {
- "webdriverio": {
+ "playwright": {
"optional": true
},
"safaridriver": {
"optional": true
},
- "playwright": {
+ "webdriverio": {
"optional": true
}
},
diff --git a/packages/browser/src/client/runner.ts b/packages/browser/src/client/runner.ts
index 64259d1e83c1..63a9be827640 100644
--- a/packages/browser/src/client/runner.ts
+++ b/packages/browser/src/client/runner.ts
@@ -1,4 +1,4 @@
-import type { File, TaskResultPack, Test, VitestRunner } from '@vitest/runner'
+import type { File, Task, TaskResultPack, VitestRunner } from '@vitest/runner'
import type { ResolvedConfig } from 'vitest'
import type { VitestExecutor } from 'vitest/execute'
import { rpc } from './rpc'
@@ -16,10 +16,10 @@ interface CoverageHandler {
}
export function createBrowserRunner(
- VitestRunner: { new(config: ResolvedConfig): VitestRunner },
+ runnerClass: { new(config: ResolvedConfig): VitestRunner },
coverageModule: CoverageHandler | null,
): { new(options: BrowserRunnerOptions): VitestRunner } {
- return class BrowserTestRunner extends VitestRunner {
+ return class BrowserTestRunner extends runnerClass implements VitestRunner {
public config: ResolvedConfig
hashMap = browserHashMap
@@ -28,7 +28,7 @@ export function createBrowserRunner(
this.config = options.config
}
- async onAfterRunTask(task: Test) {
+ onAfterRunTask = async (task: Task) => {
await super.onAfterRunTask?.(task)
if (this.config.bail && task.result?.state === 'fail') {
@@ -42,7 +42,7 @@ export function createBrowserRunner(
}
}
- async onAfterRunFiles(files: File[]) {
+ onAfterRunFiles = async (files: File[]) => {
await super.onAfterRunFiles?.(files)
const coverage = await coverageModule?.takeCoverage?.()
@@ -55,15 +55,15 @@ export function createBrowserRunner(
}
}
- onCollected(files: File[]): unknown {
+ onCollected = (files: File[]): unknown => {
return rpc().onCollected(files)
}
- onTaskUpdate(task: TaskResultPack[]): Promise {
+ onTaskUpdate = (task: TaskResultPack[]): Promise => {
return rpc().onTaskUpdate(task)
}
- async importFile(filepath: string) {
+ importFile = async (filepath: string) => {
let [test, hash] = this.hashMap.get(filepath) ?? [false, '']
if (hash === '') {
hash = Date.now().toString()
diff --git a/packages/browser/src/client/utils.ts b/packages/browser/src/client/utils.ts
index 69c7f0556262..4880c2f2a100 100644
--- a/packages/browser/src/client/utils.ts
+++ b/packages/browser/src/client/utils.ts
@@ -14,9 +14,9 @@ interface BrowserRunnerState {
runningFiles: string[]
moduleCache: WorkerGlobalState['moduleCache']
config: ResolvedConfig
- exportAll(): void
- wrapModule(module: any): any
- runTests(tests: string[]): Promise
+ exportAll: () => void
+ wrapModule: (module: any) => any
+ runTests: (tests: string[]) => Promise
}
export function getBrowserState(): BrowserRunnerState {
diff --git a/packages/coverage-istanbul/src/provider.ts b/packages/coverage-istanbul/src/provider.ts
index f869bb4b57a6..e80029f51510 100644
--- a/packages/coverage-istanbul/src/provider.ts
+++ b/packages/coverage-istanbul/src/provider.ts
@@ -32,8 +32,8 @@ interface TestExclude {
excludeNodeModules?: boolean
relativePath?: boolean
}): {
- shouldInstrument(filePath: string): boolean
- glob(cwd: string): Promise
+ shouldInstrument: (filePath: string) => boolean
+ glob: (cwd: string) => Promise
}
}
diff --git a/packages/coverage-v8/src/provider.ts b/packages/coverage-v8/src/provider.ts
index e393ddc7abc1..18e225c43be0 100644
--- a/packages/coverage-v8/src/provider.ts
+++ b/packages/coverage-v8/src/provider.ts
@@ -35,8 +35,8 @@ interface TestExclude {
excludeNodeModules?: boolean
relativePath?: boolean
}): {
- shouldInstrument(filePath: string): boolean
- glob(cwd: string): Promise
+ shouldInstrument: (filePath: string) => boolean
+ glob: (cwd: string) => Promise
}
}
diff --git a/packages/expect/src/jest-asymmetric-matchers.ts b/packages/expect/src/jest-asymmetric-matchers.ts
index 424311d0143c..76759c3b8164 100644
--- a/packages/expect/src/jest-asymmetric-matchers.ts
+++ b/packages/expect/src/jest-asymmetric-matchers.ts
@@ -6,10 +6,10 @@ import { diff, getCustomEqualityTesters, getMatcherUtils, stringify } from './je
import { equals, isA, iterableEquality, pluralize, subsetEquality } from './jest-utils'
export interface AsymmetricMatcherInterface {
- asymmetricMatch(other: unknown): boolean
- toString(): string
- getExpectedType?(): string
- toAsymmetricMatcher?(): string
+ asymmetricMatch: (other: unknown) => boolean
+ toString: () => string
+ getExpectedType?: () => string
+ toAsymmetricMatcher?: () => string
}
export abstract class AsymmetricMatcher<
diff --git a/packages/expect/src/types.ts b/packages/expect/src/types.ts
index 44df324761fc..7b1ed307f0c1 100644
--- a/packages/expect/src/types.ts
+++ b/packages/expect/src/types.ts
@@ -91,72 +91,72 @@ export type MatchersObject = Record(actual: T, message?: string): Assertion
- unreachable(message?: string): never
- soft(actual: T, message?: string): Assertion
- extend(expects: MatchersObject): void
- addEqualityTesters(testers: Array): void
- assertions(expected: number): void
- hasAssertions(): void
- anything(): any
- any(constructor: unknown): any
- getState(): MatcherState
- setState(state: Partial): void
+ unreachable: (message?: string) => never
+ soft: (actual: T, message?: string) => Assertion
+ extend: (expects: MatchersObject) => void
+ addEqualityTesters: (testers: Array) => void
+ assertions: (expected: number) => void
+ hasAssertions: () => void
+ anything: () => any
+ any: (constructor: unknown) => any
+ getState: () => MatcherState
+ setState: (state: Partial) => void
not: AsymmetricMatchersContaining
}
export interface AsymmetricMatchersContaining {
- stringContaining(expected: string): any
- objectContaining(expected: T): any
- arrayContaining(expected: Array): any
- stringMatching(expected: string | RegExp): any
- closeTo(expected: number, precision?: number): any
+ stringContaining: (expected: string) => any
+ objectContaining: (expected: T) => any
+ arrayContaining: (expected: Array) => any
+ stringMatching: (expected: string | RegExp) => any
+ closeTo: (expected: number, precision?: number) => any
}
export interface JestAssertion extends jest.Matchers {
// Jest compact
- toEqual(expected: E): void
- toStrictEqual(expected: E): void
- toBe(expected: E): void
- toMatch(expected: string | RegExp): void
- toMatchObject(expected: E): void
- toContain(item: E): void
- toContainEqual(item: E): void
- toBeTruthy(): void
- toBeFalsy(): void
- toBeGreaterThan(num: number | bigint): void
- toBeGreaterThanOrEqual(num: number | bigint): void
- toBeLessThan(num: number | bigint): void
- toBeLessThanOrEqual(num: number | bigint): void
- toBeNaN(): void
- toBeUndefined(): void
- toBeNull(): void
- toBeDefined(): void
- toBeInstanceOf(expected: E): void
- toBeCalledTimes(times: number): void
- toHaveLength(length: number): void
- toHaveProperty(property: string | (string | number)[], value?: E): void
- toBeCloseTo(number: number, numDigits?: number): void
- toHaveBeenCalledTimes(times: number): void
- toHaveBeenCalled(): void
- toBeCalled(): void
- toHaveBeenCalledWith(...args: E): void
- toBeCalledWith(...args: E): void
- toHaveBeenNthCalledWith(n: number, ...args: E): void
- nthCalledWith(nthCall: number, ...args: E): void
- toHaveBeenLastCalledWith(...args: E): void
- lastCalledWith(...args: E): void
- toThrow(expected?: string | Constructable | RegExp | Error): void
- toThrowError(expected?: string | Constructable | RegExp | Error): void
- toReturn(): void
- toHaveReturned(): void
- toReturnTimes(times: number): void
- toHaveReturnedTimes(times: number): void
- toReturnWith(value: E): void
- toHaveReturnedWith(value: E): void
- toHaveLastReturnedWith(value: E): void
- lastReturnedWith(value: E): void
- toHaveNthReturnedWith(nthCall: number, value: E): void
- nthReturnedWith(nthCall: number, value: E): void
+ toEqual: (expected: E) => void
+ toStrictEqual: (expected: E) => void
+ toBe: (expected: E) => void
+ toMatch: (expected: string | RegExp) => void
+ toMatchObject: (expected: E) => void
+ toContain: (item: E) => void
+ toContainEqual: (item: E) => void
+ toBeTruthy: () => void
+ toBeFalsy: () => void
+ toBeGreaterThan: (num: number | bigint) => void
+ toBeGreaterThanOrEqual: (num: number | bigint) => void
+ toBeLessThan: (num: number | bigint) => void
+ toBeLessThanOrEqual: (num: number | bigint) => void
+ toBeNaN: () => void
+ toBeUndefined: () => void
+ toBeNull: () => void
+ toBeDefined: () => void
+ toBeInstanceOf: (expected: E) => void
+ toBeCalledTimes: (times: number) => void
+ toHaveLength: (length: number) => void
+ toHaveProperty: (property: string | (string | number)[], value?: E) => void
+ toBeCloseTo: (number: number, numDigits?: number) => void
+ toHaveBeenCalledTimes: (times: number) => void
+ toHaveBeenCalled: () => void
+ toBeCalled: () => void
+ toHaveBeenCalledWith: (...args: E) => void
+ toBeCalledWith: (...args: E) => void
+ toHaveBeenNthCalledWith: (n: number, ...args: E) => void
+ nthCalledWith: (nthCall: number, ...args: E) => void
+ toHaveBeenLastCalledWith: (...args: E) => void
+ lastCalledWith: (...args: E) => void
+ toThrow: (expected?: string | Constructable | RegExp | Error) => void
+ toThrowError: (expected?: string | Constructable | RegExp | Error) => void
+ toReturn: () => void
+ toHaveReturned: () => void
+ toReturnTimes: (times: number) => void
+ toHaveReturnedTimes: (times: number) => void
+ toReturnWith: (value: E) => void
+ toHaveReturnedWith: (value: E) => void
+ toHaveLastReturnedWith: (value: E) => void
+ lastReturnedWith: (value: E) => void
+ toHaveNthReturnedWith: (nthCall: number, value: E) => void
+ nthReturnedWith: (nthCall: number, value: E) => void
}
type VitestAssertion = {
@@ -176,9 +176,9 @@ type Promisify = {
}
export interface Assertion extends VitestAssertion, JestAssertion {
- toBeTypeOf(expected: 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined'): void
- toHaveBeenCalledOnce(): void
- toSatisfy(matcher: (value: E) => boolean, message?: string): void
+ toBeTypeOf: (expected: 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined') => void
+ toHaveBeenCalledOnce: () => void
+ toSatisfy: (matcher: (value: E) => boolean, message?: string) => void
resolves: Promisify>
rejects: Promisify>
diff --git a/packages/runner/src/types/runner.ts b/packages/runner/src/types/runner.ts
index 0f6fe71e68ad..6822c4903c1c 100644
--- a/packages/runner/src/types/runner.ts
+++ b/packages/runner/src/types/runner.ts
@@ -1,5 +1,16 @@
import type { DiffOptions } from '@vitest/utils/diff'
-import type { Custom, ExtendedContext, File, SequenceHooks, SequenceSetupFiles, Suite, TaskContext, TaskPopulated, TaskResultPack, Test } from './tasks'
+import type {
+ Custom,
+ ExtendedContext,
+ File,
+ SequenceHooks,
+ SequenceSetupFiles,
+ Suite,
+ Task,
+ TaskContext,
+ TaskResultPack,
+ Test,
+} from './tasks'
export interface VitestRunnerConfig {
root: string
@@ -31,75 +42,81 @@ export interface VitestRunnerConstructor {
new(config: VitestRunnerConfig): VitestRunner
}
-export type CancelReason = 'keyboard-input' | 'test-failure' | string & Record
+export type CancelReason =
+ | 'keyboard-input'
+ | 'test-failure'
+ | string & Record
export interface VitestRunner {
/**
* First thing that's getting called before actually collecting and running tests.
*/
- onBeforeCollect?(paths: string[]): unknown
+ onBeforeCollect?: (paths: string[]) => unknown
/**
* Called after collecting tests and before "onBeforeRun".
*/
- onCollected?(files: File[]): unknown
+ onCollected?: (files: File[]) => unknown
/**
* Called when test runner should cancel next test runs.
* Runner should listen for this method and mark tests and suites as skipped in
* "onBeforeRunSuite" and "onBeforeRunTask" when called.
*/
- onCancel?(reason: CancelReason): unknown
+ onCancel?: (reason: CancelReason) => unknown
/**
* Called before running a single test. Doesn't have "result" yet.
*/
- onBeforeRunTask?(test: TaskPopulated): unknown
+ onBeforeRunTask?: (test: Task) => unknown
/**
* Called before actually running the test function. Already has "result" with "state" and "startTime".
*/
- onBeforeTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
+ onBeforeTryTask?: (test: Task, options: { retry: number; repeats: number }) => unknown
/**
* Called after result and state are set.
*/
- onAfterRunTask?(test: TaskPopulated): unknown
+ onAfterRunTask?: (test: Task) => unknown
/**
* Called right after running the test function. Doesn't have new state yet. Will not be called, if the test function throws.
*/
- onAfterTryTask?(test: TaskPopulated, options: { retry: number; repeats: number }): unknown
+ onAfterTryTask?: (
+ test: Task,
+ options: { retry: number; repeats: number }
+ ) => unknown
/**
* Called before running a single suite. Doesn't have "result" yet.
*/
- onBeforeRunSuite?(suite: Suite): unknown
+ onBeforeRunSuite?: (suite: Suite) => unknown
/**
* Called after running a single suite. Has state and result.
*/
- onAfterRunSuite?(suite: Suite): unknown
+ onAfterRunSuite?: (suite: Suite) => unknown
/**
* If defined, will be called instead of usual Vitest suite partition and handling.
* "before" and "after" hooks will not be ignored.
*/
- runSuite?(suite: Suite): Promise
+ runSuite?: (suite: Suite) => Promise
/**
* If defined, will be called instead of usual Vitest handling. Useful, if you have your custom test function.
* "before" and "after" hooks will not be ignored.
*/
- runTask?(test: TaskPopulated): Promise
+ runTask?: (test: Task) => Promise
/**
* Called, when a task is updated. The same as "onTaskUpdate" in a reporter, but this is running in the same thread as tests.
*/
- onTaskUpdate?(task: TaskResultPack[]): Promise
+ onTaskUpdate?: (task: TaskResultPack[]) => Promise
/**
* Called before running all tests in collected paths.
*/
- onBeforeRunFiles?(files: File[]): unknown
+ onBeforeRunFiles?: (files: File[]) => unknown
/**
* Called right after running all tests in collected paths.
*/
- onAfterRunFiles?(files: File[]): unknown
+ onAfterRunFiles?: (files: File[]) => unknown
/**
* Called when new context for a test is defined. Useful, if you want to add custom properties to the context.
* If you only want to define custom context, consider using "beforeAll" in "setupFiles" instead.
@@ -108,11 +125,13 @@ export interface VitestRunner {
*
* @see https://vitest.dev/advanced/runner.html#your-task-function
*/
- extendTaskContext?(context: TaskContext): ExtendedContext
+ extendTaskContext?: (
+ context: TaskContext
+ ) => ExtendedContext
/**
* Called, when files are imported. Can be called in two situations: when collecting tests and when importing setup files.
*/
- importFile(filepath: string, source: VitestRunnerImportSource): unknown
+ importFile: (filepath: string, source: VitestRunnerImportSource) => unknown
/**
* Publicly available configuration.
*/
diff --git a/packages/runner/src/types/tasks.ts b/packages/runner/src/types/tasks.ts
index 199ff8dc8c4b..57895ee11055 100644
--- a/packages/runner/src/types/tasks.ts
+++ b/packages/runner/src/types/tasks.ts
@@ -193,19 +193,19 @@ export interface TestOptions {
interface ExtendedAPI {
each: TestEachFunction
- skipIf(condition: any): ChainableTestAPI
- runIf(condition: any): ChainableTestAPI
+ skipIf: (condition: any) => ChainableTestAPI
+ runIf: (condition: any) => ChainableTestAPI
}
export type CustomAPI = ChainableTestAPI & ExtendedAPI & {
- extend = {}>(fixtures: Fixtures): CustomAPI<{
+ extend: = {}>(fixtures: Fixtures) => CustomAPI<{
[K in keyof T | keyof ExtraContext]:
K extends keyof T ? T[K] :
K extends keyof ExtraContext ? ExtraContext[K] : never }>
}
export type TestAPI = ChainableTestAPI & ExtendedAPI & {
- extend = {}>(fixtures: Fixtures): TestAPI<{
+ extend: = {}>(fixtures: Fixtures) => TestAPI<{
[K in keyof T | keyof ExtraContext]:
K extends keyof T ? T[K] :
K extends keyof ExtraContext ? ExtraContext[K] : never }>
@@ -236,8 +236,8 @@ type ChainableSuiteAPI = ChainableFunction<
export type SuiteAPI = ChainableSuiteAPI & {
each: SuiteEachFunction
- skipIf(condition: any): ChainableSuiteAPI
- runIf(condition: any): ChainableSuiteAPI
+ skipIf: (condition: any) => ChainableSuiteAPI
+ runIf: (condition: any) => ChainableSuiteAPI
}
export type HookListener = (...args: T) => Awaitable
diff --git a/packages/snapshot/README.md b/packages/snapshot/README.md
index a89d9fe59680..4c4ecda2260b 100644
--- a/packages/snapshot/README.md
+++ b/packages/snapshot/README.md
@@ -76,4 +76,4 @@ manager.add(result)
// and then read the summary
console.log(manager.summary)
-```
\ No newline at end of file
+```
diff --git a/packages/snapshot/src/types/environment.ts b/packages/snapshot/src/types/environment.ts
index 57776314fb5d..ff79cc1db860 100644
--- a/packages/snapshot/src/types/environment.ts
+++ b/packages/snapshot/src/types/environment.ts
@@ -1,11 +1,11 @@
export interface SnapshotEnvironment {
- getVersion(): string
- getHeader(): string
- resolvePath(filepath: string): Promise
- resolveRawPath(testPath: string, rawPath: string): Promise
- saveSnapshotFile(filepath: string, snapshot: string): Promise
- readSnapshotFile(filepath: string): Promise
- removeSnapshotFile(filepath: string): Promise
+ getVersion: () => string
+ getHeader: () => string
+ resolvePath: (filepath: string) => Promise
+ resolveRawPath: (testPath: string, rawPath: string) => Promise
+ saveSnapshotFile: (filepath: string, snapshot: string) => Promise
+ readSnapshotFile: (filepath: string) => Promise
+ removeSnapshotFile: (filepath: string) => Promise
}
export interface SnapshotEnvironmentOptions {
diff --git a/packages/spy/src/index.ts b/packages/spy/src/index.ts
index 023b7095700d..6e3315b56e00 100644
--- a/packages/spy/src/index.ts
+++ b/packages/spy/src/index.ts
@@ -113,11 +113,11 @@ export interface MockInstance {
/**
* Use it to return the name given to mock with method `.mockName(name)`.
*/
- getMockName(): string
+ getMockName: () => string
/**
* Sets internal mock name. Useful to see the name of the mock if an assertion fails.
*/
- mockName(n: string): this
+ mockName: (n: string) => this
/**
* Current context of the mock. It stores information about all invocation calls, instances, and results.
*/
@@ -127,19 +127,19 @@ export interface MockInstance {
*
* It is useful if you need to clean up mock between different assertions.
*/
- mockClear(): this
+ mockClear: () => this
/**
* Does what `mockClear` does and makes inner implementation an empty function (returning `undefined` when invoked). This also resets all "once" implementations.
*
* This is useful when you want to completely reset a mock to the default state.
*/
- mockReset(): this
+ mockReset: () => this
/**
* Does what `mockReset` does and restores inner implementation to the original function.
*
* Note that restoring mock from `vi.fn()` will set implementation to an empty function that returns `undefined`. Restoring a `vi.fn(impl)` will restore implementation to `impl`.
*/
- mockRestore(): void
+ mockRestore: () => void
/**
* Returns current mock implementation if there is one.
*
@@ -147,14 +147,14 @@ export interface MockInstance {
*
* If mock was created with `vi.spyOn`, it will return `undefined` unless a custom implementation was provided.
*/
- getMockImplementation(): ((...args: TArgs) => TReturns) | undefined
+ getMockImplementation: () => ((...args: TArgs) => TReturns) | undefined
/**
* Accepts a function that will be used as an implementation of the mock.
* @example
* const increment = vi.fn().mockImplementation(count => count + 1);
* expect(increment(3)).toBe(4);
*/
- mockImplementation(fn: ((...args: TArgs) => TReturns)): this
+ mockImplementation: (fn: ((...args: TArgs) => TReturns)) => this
/**
* Accepts a function that will be used as a mock implementation during the next call. Can be chained so that multiple function calls produce different results.
* @example
@@ -162,7 +162,7 @@ export interface MockInstance {
* expect(fn(3)).toBe(4);
* expect(fn(3)).toBe(3);
*/
- mockImplementationOnce(fn: ((...args: TArgs) => TReturns)): this
+ mockImplementationOnce: (fn: ((...args: TArgs) => TReturns)) => this
/**
* Overrides the original mock implementation temporarily while the callback is being executed.
* @example
@@ -174,15 +174,15 @@ export interface MockInstance {
*
* myMockFn() // 'original'
*/
- withImplementation(fn: ((...args: TArgs) => TReturns), cb: () => T): T extends Promise ? Promise : this
+ withImplementation: (fn: ((...args: TArgs) => TReturns), cb: () => T) => T extends Promise ? Promise : this
/**
* Use this if you need to return `this` context from the method without invoking actual implementation.
*/
- mockReturnThis(): this
+ mockReturnThis: () => this
/**
* Accepts a value that will be returned whenever the mock function is called.
*/
- mockReturnValue(obj: TReturns): this
+ mockReturnValue: (obj: TReturns) => this
/**
* Accepts a value that will be returned during the next function call. If chained, every consecutive call will return the specified value.
*
@@ -197,14 +197,14 @@ export interface MockInstance {
* // 'first call', 'second call', 'default'
* console.log(myMockFn(), myMockFn(), myMockFn())
*/
- mockReturnValueOnce(obj: TReturns): this
+ mockReturnValueOnce: (obj: TReturns) => this
/**
* Accepts a value that will be resolved when async function is called.
* @example
* const asyncMock = vi.fn().mockResolvedValue(42)
* asyncMock() // Promise<42>
*/
- mockResolvedValue(obj: Awaited): this
+ mockResolvedValue: (obj: Awaited) => this
/**
* Accepts a value that will be resolved during the next function call. If chained, every consecutive call will resolve specified value.
* @example
@@ -217,14 +217,14 @@ export interface MockInstance {
* // Promise<'first call'>, Promise<'second call'>, Promise<'default'>
* console.log(myMockFn(), myMockFn(), myMockFn())
*/
- mockResolvedValueOnce(obj: Awaited): this
+ mockResolvedValueOnce: (obj: Awaited) => this
/**
* Accepts an error that will be rejected when async function is called.
* @example
* const asyncMock = vi.fn().mockRejectedValue(new Error('Async error'))
* await asyncMock() // throws 'Async error'
*/
- mockRejectedValue(obj: any): this
+ mockRejectedValue: (obj: any) => this
/**
* Accepts a value that will be rejected during the next function call. If chained, every consecutive call will reject specified value.
* @example
@@ -236,7 +236,7 @@ export interface MockInstance {
* await asyncMock() // first call
* await asyncMock() // throws "Async error"
*/
- mockRejectedValueOnce(obj: any): this
+ mockRejectedValueOnce: (obj: any) => this
}
export interface Mock extends MockInstance {
diff --git a/packages/ui/cypress/support/mount.ts b/packages/ui/cypress/support/mount.ts
index d1fd06678c0d..13b220dab69c 100644
--- a/packages/ui/cypress/support/mount.ts
+++ b/packages/ui/cypress/support/mount.ts
@@ -28,7 +28,7 @@ declare global {
/**
* Install all vue plugins and globals then mount
*/
- mount(comp: Component, options?: unknown): Cypress.Chainable
+ mount: (comp: Component, options?: unknown) => Cypress.Chainable
}
}
}
diff --git a/packages/vite-node/src/hmr/emitter.ts b/packages/vite-node/src/hmr/emitter.ts
index 924a8030dd70..06afe9862987 100644
--- a/packages/vite-node/src/hmr/emitter.ts
+++ b/packages/vite-node/src/hmr/emitter.ts
@@ -4,10 +4,9 @@ import type { HMRPayload, Plugin } from 'vite'
export type EventType = string | symbol
export type Handler = (event: T) => void
export interface Emitter> {
- on(type: Key, handler: Handler): void
- off(type: Key, handler?: Handler): void
- emit(type: Key, event: Events[Key]): void
- emit(type: undefined extends Events[Key] ? Key : never): void
+ on: (type: Key, handler: Handler) => void
+ off: (type: Key, handler?: Handler) => void
+ emit: ((type: Key, event: Events[Key]) => void) & ((type: undefined extends Events[Key] ? Key : never) => void)
}
export type HMREmitter = Emitter<{
@@ -22,7 +21,7 @@ declare module 'vite' {
export function createHmrEmitter(): HMREmitter {
const emitter = new EventEmitter()
- return emitter
+ return emitter as HMREmitter
}
export function viteNodeHmrPlugin(): Plugin {
diff --git a/packages/vite-node/src/source-map-handler.ts b/packages/vite-node/src/source-map-handler.ts
index f71af8e83d8f..383416906b0b 100644
--- a/packages/vite-node/src/source-map-handler.ts
+++ b/packages/vite-node/src/source-map-handler.ts
@@ -225,7 +225,7 @@ function mapEvalOrigin(origin: string): string {
}
interface CallSite extends NodeJS.CallSite {
- getScriptNameOrSourceURL(): string
+ getScriptNameOrSourceURL: () => string
}
// This is copied almost verbatim from the V8 source code at
diff --git a/packages/vitest/package.json b/packages/vitest/package.json
index 8abd6af8b062..7b5550e666d3 100644
--- a/packages/vitest/package.json
+++ b/packages/vitest/package.json
@@ -121,22 +121,22 @@
"jsdom": "*"
},
"peerDependenciesMeta": {
- "@types/node": {
+ "@edge-runtime/vm": {
"optional": true
},
- "@vitest/ui": {
+ "@types/node": {
"optional": true
},
"@vitest/browser": {
"optional": true
},
- "happy-dom": {
+ "@vitest/ui": {
"optional": true
},
- "jsdom": {
+ "happy-dom": {
"optional": true
},
- "@edge-runtime/vm": {
+ "jsdom": {
"optional": true
}
},
diff --git a/packages/vitest/src/api/types.ts b/packages/vitest/src/api/types.ts
index 6dba431c24d6..333182a93ce5 100644
--- a/packages/vitest/src/api/types.ts
+++ b/packages/vitest/src/api/types.ts
@@ -7,36 +7,36 @@ export interface TransformResultWithSource extends TransformResult {
}
export interface WebSocketHandlers {
- onUnhandledError(error: unknown, type: string): Promise
- onCollected(files?: File[]): Promise
- onTaskUpdate(packs: TaskResultPack[]): void
- onAfterSuiteRun(meta: AfterSuiteRunMeta): void
- onCancel(reason: CancelReason): void
- getCountOfFailedTests(): number
- sendLog(log: UserConsoleLog): void
- getFiles(): File[]
- getPaths(): string[]
- getConfig(): ResolvedConfig
- resolveSnapshotPath(testPath: string): string
- resolveSnapshotRawPath(testPath: string, rawPath: string): string
- getModuleGraph(id: string): Promise
- getTransformResult(id: string): Promise
- readSnapshotFile(id: string): Promise
- readTestFile(id: string): Promise
- saveTestFile(id: string, content: string): Promise
- saveSnapshotFile(id: string, content: string): Promise
- removeSnapshotFile(id: string): Promise
- snapshotSaved(snapshot: SnapshotResult): void
- rerun(files: string[]): Promise
- updateSnapshot(file?: File): Promise
- getProvidedContext(): ProvidedContext
- getUnhandledErrors(): unknown[]
+ onUnhandledError: (error: unknown, type: string) => Promise
+ onCollected: (files?: File[]) => Promise
+ onTaskUpdate: (packs: TaskResultPack[]) => void
+ onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void
+ onCancel: (reason: CancelReason) => void
+ getCountOfFailedTests: () => number
+ sendLog: (log: UserConsoleLog) => void
+ getFiles: () => File[]
+ getPaths: () => string[]
+ getConfig: () => ResolvedConfig
+ resolveSnapshotPath: (testPath: string) => string
+ resolveSnapshotRawPath: (testPath: string, rawPath: string) => string
+ getModuleGraph: (id: string) => Promise
+ getTransformResult: (id: string) => Promise
+ readSnapshotFile: (id: string) => Promise
+ readTestFile: (id: string) => Promise
+ saveTestFile: (id: string, content: string) => Promise
+ saveSnapshotFile: (id: string, content: string) => Promise
+ removeSnapshotFile: (id: string) => Promise
+ snapshotSaved: (snapshot: SnapshotResult) => void
+ rerun: (files: string[]) => Promise
+ updateSnapshot: (file?: File) => Promise
+ getProvidedContext: () => ProvidedContext
+ getUnhandledErrors: () => unknown[]
- finishBrowserTests(): void
- getBrowserFiles(): string[]
- debug(...args: string[]): void
+ finishBrowserTests: () => void
+ getBrowserFiles: () => string[]
+ debug: (...args: string[]) => void
}
export interface WebSocketEvents extends Pick {
- onCancel(reason: CancelReason): void
+ onCancel: (reason: CancelReason) => void
}
diff --git a/packages/vitest/src/integrations/vi.ts b/packages/vitest/src/integrations/vi.ts
index 052db9b9f141..72b438fa83ff 100644
--- a/packages/vitest/src/integrations/vi.ts
+++ b/packages/vitest/src/integrations/vi.ts
@@ -18,76 +18,76 @@ export interface VitestUtils {
/**
* Checks if fake timers are enabled.
*/
- isFakeTimers(): boolean
+ isFakeTimers: () => boolean
/**
* This method wraps all further calls to timers until [`vi.useRealTimers()`](https://vitest.dev/api/vi#vi-userealtimers) is called.
*/
- useFakeTimers(config?: FakeTimerInstallOpts): VitestUtils
+ useFakeTimers: (config?: FakeTimerInstallOpts) => VitestUtils
/**
* Restores mocked timers to their original implementations. All timers that were scheduled before will be discarded.
*/
- useRealTimers(): VitestUtils
+ useRealTimers: () => VitestUtils
/**
* This method will call every timer that was initiated after [`vi.useFakeTimers`](https://vitest.dev/api/vi#vi-usefaketimers) call.
* It will not fire any timer that was initiated during its call.
*/
- runOnlyPendingTimers(): VitestUtils
+ runOnlyPendingTimers: () => VitestUtils
/**
* This method will asynchronously call every timer that was initiated after [`vi.useFakeTimers`](https://vitest.dev/api/vi#vi-usefaketimers) call, even asynchronous ones.
* It will not fire any timer that was initiated during its call.
*/
- runOnlyPendingTimersAsync(): Promise
+ runOnlyPendingTimersAsync: () => Promise
/**
* This method will invoke every initiated timer until the timer queue is empty. It means that every timer called during `runAllTimers` will be fired.
* If you have an infinite interval, it will throw after 10,000 tries (can be configured with [`fakeTimers.loopLimit`](https://vitest.dev/config/#faketimers-looplimit)).
*/
- runAllTimers(): VitestUtils
+ runAllTimers: () => VitestUtils
/**
* This method will asynchronously invoke every initiated timer until the timer queue is empty. It means that every timer called during `runAllTimersAsync` will be fired even asynchronous timers.
* If you have an infinite interval, it will throw after 10 000 tries (can be configured with [`fakeTimers.loopLimit`](https://vitest.dev/config/#faketimers-looplimit)).
*/
- runAllTimersAsync(): Promise
+ runAllTimersAsync: () => Promise
/**
* Calls every microtask that was queued by `process.nextTick`. This will also run all microtasks scheduled by themselves.
*/
- runAllTicks(): VitestUtils
+ runAllTicks: () => VitestUtils
/**
* This method will invoke every initiated timer until the specified number of milliseconds is passed or the queue is empty - whatever comes first.
*/
- advanceTimersByTime(ms: number): VitestUtils
+ advanceTimersByTime: (ms: number) => VitestUtils
/**
* This method will invoke every initiated timer until the specified number of milliseconds is passed or the queue is empty - whatever comes first. This will include and await asynchronously set timers.
*/
- advanceTimersByTimeAsync(ms: number): Promise
+ advanceTimersByTimeAsync: (ms: number) => Promise
/**
* Will call next available timer. Useful to make assertions between each timer call. You can chain call it to manage timers by yourself.
*/
- advanceTimersToNextTimer(): VitestUtils
+ advanceTimersToNextTimer: () => VitestUtils
/**
* Will call next available timer and wait until it's resolved if it was set asynchronously. Useful to make assertions between each timer call.
*/
- advanceTimersToNextTimerAsync(): Promise
+ advanceTimersToNextTimerAsync: () => Promise
/**
* Get the number of waiting timers.
*/
- getTimerCount(): number
+ getTimerCount: () => number
/**
* If fake timers are enabled, this method simulates a user changing the system clock (will affect date related API like `hrtime`, `performance.now` or `new Date()`) - however, it will not fire any timers.
* If fake timers are not enabled, this method will only mock `Date.*` and `new Date()` calls.
*/
- setSystemTime(time: number | string | Date): VitestUtils
+ setSystemTime: (time: number | string | Date) => VitestUtils
/**
* Returns mocked current date that was set using `setSystemTime`. If date is not mocked the method will return `null`.
*/
- getMockedSystemTime(): Date | null
+ getMockedSystemTime: () => Date | null
/**
* When using `vi.useFakeTimers`, `Date.now` calls are mocked. If you need to get real time in milliseconds, you can call this function.
*/
- getRealSystemTime(): number
+ getRealSystemTime: () => number
/**
* Removes all timers that are scheduled to run. These timers will never run in the future.
*/
- clearAllTimers(): VitestUtils
+ clearAllTimers: () => VitestUtils
/**
* Creates a spy on a method or getter/setter of an object similar to [`vi.fn()`](https://vitest.dev/api/vi#vi-fn). It returns a [mock function](https://vitest.dev/api/mock).
@@ -172,7 +172,7 @@ export interface VitestUtils {
*
* If used with [`vi.mock`](https://vitest.dev/api/vi#vi-mock), both will be hoisted in the order they are defined in.
*/
- hoisted(factory: () => T): T
+ hoisted: (factory: () => T) => T
/**
* Mocks every import call to the module even if it was already statically imported.
@@ -184,7 +184,7 @@ export interface VitestUtils {
* @param path Path to the module. Can be aliased, if your Vitest config supports it
* @param factory Mocked module factory. The result of this function will be an exports object
*/
- mock(path: string, factory?: MockFactoryWithHelper): void
+ mock: (path: string, factory?: MockFactoryWithHelper) => void
/**
* Removes module from mocked registry. All calls to import will return the original module even if it was mocked before.
@@ -192,7 +192,7 @@ export interface VitestUtils {
* This call is hoisted to the top of the file, so it will only unmock modules that were defined in `setupFiles`, for example.
* @param path Path to the module. Can be aliased, if your Vitest config supports it
*/
- unmock(path: string): void
+ unmock: (path: string) => void
/**
* Mocks every subsequent [dynamic import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) call.
@@ -203,14 +203,14 @@ export interface VitestUtils {
* @param path Path to the module. Can be aliased, if your Vitest config supports it
* @param factory Mocked module factory. The result of this function will be an exports object
*/
- doMock(path: string, factory?: MockFactoryWithHelper): void
+ doMock: (path: string, factory?: MockFactoryWithHelper) => void
/**
* Removes module from mocked registry. All subsequent calls to import will return original module.
*
* Unlike [`vi.unmock`](https://vitest.dev/api/vi#vi-unmock), this method is not hoisted to the top of the file.
* @param path Path to the module. Can be aliased, if your Vitest config supports it
*/
- doUnmock(path: string): void
+ doUnmock: (path: string) => void
/**
* Imports module, bypassing all checks if it should be mocked.
@@ -223,7 +223,7 @@ export interface VitestUtils {
* })
* @param path Path to the module. Can be aliased, if your config supports it
*/
- importActual(path: string): Promise
+ importActual: (path: string) => Promise
/**
* Imports a module with all of its properties and nested properties mocked.
@@ -236,7 +236,7 @@ export interface VitestUtils {
* @param path Path to the module. Can be aliased, if your config supports it
* @returns Fully mocked module
*/
- importMock(path: string): Promise>
+ importMock: (path: string) => Promise>
/**
* Type helper for TypeScript. Just returns the object that was passed.
@@ -255,60 +255,54 @@ export interface VitestUtils {
* @param deep If the object is deeply mocked
* @param options If the object is partially or deeply mocked
*/
- mocked(item: T, deep?: false): MaybeMocked
- mocked(item: T, deep: true): MaybeMockedDeep
- mocked(item: T, options: { partial?: false; deep?: false }): MaybeMocked
- mocked(item: T, options: { partial?: false; deep: true }): MaybeMockedDeep
- mocked(item: T, options: { partial: true; deep?: false }): MaybePartiallyMocked
- mocked(item: T, options: { partial: true; deep: true }): MaybePartiallyMockedDeep
- mocked(item: T): MaybeMocked
+ mocked: ((item: T, deep?: false) => MaybeMocked) & ((item: T, deep: true) => MaybeMockedDeep) & ((item: T, options: { partial?: false; deep?: false }) => MaybeMocked) & ((item: T, options: { partial?: false; deep: true }) => MaybeMockedDeep