diff --git a/package.json b/package.json index 35abe7f7c5..4ed76f8572 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@commitlint/config-conventional": "^18.4.2", "@types/node": "^20.9.0", "@types/webpack-env": "^1.18.4", - "@vitest/coverage-istanbul": "^0.34.6", + "@vitest/coverage-istanbul": "1.0.0-beta.4", "bumpp": "^9.2.0", "conventional-changelog-cli": "^4.1.0", "cpx2": "^6.0.1", @@ -59,7 +59,7 @@ "tsup": "^7.2.0", "typescript": "^5.2.2", "vite": "~5.0.0", - "vitest": "^0.34.6" + "vitest": "1.0.0-beta.4" }, "packageManager": "pnpm@8.10.5", "engines": { diff --git a/packages/markdown/tests/plugins/__snapshots__/codePlugin.spec.ts.snap b/packages/markdown/tests/plugins/__snapshots__/codePlugin.spec.ts.snap index d0df49b335..45c7218938 100644 --- a/packages/markdown/tests/plugins/__snapshots__/codePlugin.spec.ts.snap +++ b/packages/markdown/tests/plugins/__snapshots__/codePlugin.spec.ts.snap @@ -1,203 +1,203 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`@vuepress/markdown > plugins > codePlugin > :line-numbers / :no-line-numbers > should work properly if \`lineNumbers\` is disabled by default 1`] = ` -"
Raw text
-
Raw text
-
Raw text
-
const foo = 'foo'
+"Raw text
+
Raw text
+
Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
"
+
Raw text
-
Raw text
-
Raw text
-
const foo = 'foo'
+"Raw text
+
Raw text
+
Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
"
+
Raw text
-
Raw text
-
Raw text
-
const foo = 'foo'
+"Raw text
+
Raw text
+
Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
"
+
Raw text
-
Raw text
-
Raw text
-
const foo = 'foo'
+"Raw text
+
Raw text
+
Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
"
+
Raw text
-
Raw text
-
Raw text
-
const foo = 'foo'
+"Raw text
+
Raw text
+
Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
"
+
Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -206,23 +206,23 @@ function bar () {
const baz = () => {
return 2048
}
-
{{ inlineCode }}
+
{{ inlineCode }}
Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -231,23 +231,23 @@ function bar () {
const baz = () => {
return 2048
}
-
{{ inlineCode }}
+
{{ inlineCode }}
Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -261,18 +261,18 @@ const baz = () => {
`;
exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should disable \`vPre.block\` 1`] = `
-"Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -281,23 +281,23 @@ function bar () {
const baz = () => {
return 2048
}
-
{{ inlineCode }}
+
{{ inlineCode }}
"
`;
exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should disable \`vPre.inline\` 1`] = `
-"Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -306,23 +306,23 @@ function bar () {
const baz = () => {
return 2048
}
-
{{ inlineCode }}
+
{{ inlineCode }}
"
`;
exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should disable \`vPre.inline\` and \`vPre.block\` 1`] = `
-"Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -331,23 +331,23 @@ function bar () {
const baz = () => {
return 2048
}
-
{{ inlineCode }}
+
{{ inlineCode }}
"
`;
exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should enable \`lineNumbers\` according to number of code lines 1`] = `
-"Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -356,23 +356,23 @@ function bar () {
const baz = () => {
return 2048
}
-
{{ inlineCode }}
+
{{ inlineCode }}
"
`;
exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should process code fences with default options 1`] = `
-"Raw text
-
const foo = 'foo'
+"Raw text
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
}
-
const foo = 'foo'
+
const foo = 'foo'
function bar () {
return 1024
@@ -381,48 +381,48 @@ function bar () {
const baz = () => {
return 2048
}
-
{{ inlineCode }}
+
{{ inlineCode }}
"
`;
exports[`@vuepress/markdown > plugins > codePlugin > syntax highlighting > should work if highlighted code is not wrapped with \`\` 1`] = `
-"highlighted code: Raw text
-, lang: text
highlighted code: const foo = 'foo'
+"highlighted code: Raw text
+, lang: text
highlighted code: const foo = 'foo'
function bar () {
return 1024
}
-, lang: javascript
highlighted code: const foo: string = 'foo'
+, lang: javascript
highlighted code: const foo: string = 'foo'
function bar (): number {
return 1024
}
-, lang: typescript
highlighted code:
+, lang: typescript
highlighted code:
msg: {{msg}}
-
-, lang: vue-html
"
+, lang: vue-html
"
`;
exports[`@vuepress/markdown > plugins > codePlugin > syntax highlighting > should work if highlighted code is wrapped with \`\` 1`] = `
-"highlighted code: Raw text
-, lang: text
highlighted code: const foo = 'foo'
+"highlighted code: Raw text
+, lang: text
highlighted code: const foo = 'foo'
function bar () {
return 1024
}
-, lang: javascript
highlighted code: const foo: string = 'foo'
+, lang: javascript
highlighted code: const foo: string = 'foo'
function bar (): number {
return 1024
}
-, lang: typescript
highlighted code:
+, lang: typescript
highlighted code:
msg: {{msg}}
-
-, lang: vue-html
"
+, lang: vue-html
"
`;
diff --git a/packages/markdown/tests/plugins/__snapshots__/importCodePlugin.spec.ts.snap b/packages/markdown/tests/plugins/__snapshots__/importCodePlugin.spec.ts.snap
index 585aac8c7a..93903467e7 100644
--- a/packages/markdown/tests/plugins/__snapshots__/importCodePlugin.spec.ts.snap
+++ b/packages/markdown/tests/plugins/__snapshots__/importCodePlugin.spec.ts.snap
@@ -1,12 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`@vuepress/markdown > plugins > importCodePlugin > compatibility with codePlugin > should work with syntax supported by codePlugin 1`] = `
-"const msg = 'hello from js'
+"const msg = 'hello from js'
console.log(msg)
console.log('foo bar')
-
# msg
+
# msg
hello from md
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index bb6dbd967c..fc3c01b78e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -21,8 +21,8 @@ importers:
specifier: ^1.18.4
version: 1.18.4
'@vitest/coverage-istanbul':
- specifier: ^0.34.6
- version: 0.34.6(vitest@0.34.6)
+ specifier: 1.0.0-beta.4
+ version: 1.0.0-beta.4(vitest@1.0.0-beta.4)
bumpp:
specifier: ^9.2.0
version: 9.2.0
@@ -72,8 +72,8 @@ importers:
specifier: ~5.0.0
version: 5.0.0(@types/node@20.9.0)
vitest:
- specifier: ^0.34.6
- version: 0.34.6
+ specifier: 1.0.0-beta.4
+ version: 1.0.0-beta.4(@types/node@20.9.0)
docs:
dependencies:
@@ -3171,16 +3171,6 @@ packages:
'@types/node': 20.9.0
dev: false
- /@types/chai-subset@1.3.5:
- resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==}
- dependencies:
- '@types/chai': 4.3.10
- dev: true
-
- /@types/chai@4.3.10:
- resolution: {integrity: sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg==}
- dev: true
-
/@types/connect-history-api-fallback@1.5.0:
resolution: {integrity: sha512-4x5FkPpLipqwthjPsF7ZRbOv3uoLUFkTA9G9v583qi4pACvq0uTELrB8OLUzPWUI4IJIyvM85vzkV1nyiI2Lig==}
dependencies:
@@ -3549,10 +3539,10 @@ packages:
vue: 3.3.8(typescript@5.2.2)
dev: false
- /@vitest/coverage-istanbul@0.34.6(vitest@0.34.6):
- resolution: {integrity: sha512-5KaBNZPDSk2ybavC3rZ1pWGniw7sJ5usuwVGRUYzJwiBfWvnLpuUer7bjw7qUCRGdKJXrBgb/Dsgif9rkwMX/A==}
+ /@vitest/coverage-istanbul@1.0.0-beta.4(vitest@1.0.0-beta.4):
+ resolution: {integrity: sha512-4E25KwGOpEjP2GM9uWDlD58w3OkGFABCqEoBlEnY5AXQKQBLUlKkSMPXqp3fYRrOrQcnOaPFV7c8rMd6tsUAlg==}
peerDependencies:
- vitest: '>=0.32.0 <1'
+ vitest: ^1.0.0-0
dependencies:
istanbul-lib-coverage: 3.2.2
istanbul-lib-instrument: 6.0.1
@@ -3561,43 +3551,43 @@ packages:
istanbul-reports: 3.1.6
picocolors: 1.0.0
test-exclude: 6.0.0
- vitest: 0.34.6
+ vitest: 1.0.0-beta.4(@types/node@20.9.0)
transitivePeerDependencies:
- supports-color
dev: true
- /@vitest/expect@0.34.6:
- resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==}
+ /@vitest/expect@1.0.0-beta.4:
+ resolution: {integrity: sha512-JOpNEva2AFxfySH3F+X+hT52Kq/ZdIrGtzWYbj6yRuBuxFqM55n/7/jV4XtQG+XkmehP3OUZGx5zISOU8KHPQw==}
dependencies:
- '@vitest/spy': 0.34.6
- '@vitest/utils': 0.34.6
+ '@vitest/spy': 1.0.0-beta.4
+ '@vitest/utils': 1.0.0-beta.4
chai: 4.3.10
dev: true
- /@vitest/runner@0.34.6:
- resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==}
+ /@vitest/runner@1.0.0-beta.4:
+ resolution: {integrity: sha512-rlXCMp5MxMVVVN5hdhzPL9NpIkfZC0EXwAtN5gwBbCBoVRv9dBQiZ5qTw+LaNmugPl8gm76U4e4/nMZS9s6wyw==}
dependencies:
- '@vitest/utils': 0.34.6
+ '@vitest/utils': 1.0.0-beta.4
p-limit: 4.0.0
pathe: 1.1.1
dev: true
- /@vitest/snapshot@0.34.6:
- resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==}
+ /@vitest/snapshot@1.0.0-beta.4:
+ resolution: {integrity: sha512-CzmHLGo4RNEQUojYtuEz8wWKp9/p3hvXskejRRJB1iCRH48uWROmoyb2iEQUhgpQw/+WwI4wRP7jek5lp48pRA==}
dependencies:
magic-string: 0.30.5
pathe: 1.1.1
pretty-format: 29.7.0
dev: true
- /@vitest/spy@0.34.6:
- resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==}
+ /@vitest/spy@1.0.0-beta.4:
+ resolution: {integrity: sha512-YvKUUl7KucKzLJb8+RTd8H3G24EVPGk+CVMFawwtD/KuYjBzM8RCh3oJTTba6ktLpB8JLVy8NVTNL4Oeigqs8A==}
dependencies:
tinyspy: 2.2.0
dev: true
- /@vitest/utils@0.34.6:
- resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==}
+ /@vitest/utils@1.0.0-beta.4:
+ resolution: {integrity: sha512-YY4bhhVqyTxuNwuZJXiCM4/D0Z7Z3H3JDHNM8gXty7EyRUf4iPDQtXzIWe1r4zdTtoFnzFAeMr+891pWlv4SPA==}
dependencies:
diff-sequences: 29.6.3
loupe: 2.3.7
@@ -9606,8 +9596,8 @@ packages:
resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==}
dev: true
- /tinypool@0.7.0:
- resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==}
+ /tinypool@0.8.1:
+ resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==}
engines: {node: '>=14.0.0'}
dev: true
@@ -9993,9 +9983,9 @@ packages:
engines: {node: '>= 0.8'}
dev: false
- /vite-node@0.34.6(@types/node@20.9.0):
- resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==}
- engines: {node: '>=v14.18.0'}
+ /vite-node@1.0.0-beta.4(@types/node@20.9.0):
+ resolution: {integrity: sha512-YODjVvHd2Jih+TGMG3B99ktSyvET9w2cMevorAjcuQ3KKiPhDxEf2bRia2KsDHfnUGIfSpwoUdbcDdJ5xR7epg==}
+ engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
dependencies:
cac: 6.7.14
@@ -10050,22 +10040,22 @@ packages:
optionalDependencies:
fsevents: 2.3.3
- /vitest@0.34.6:
- resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==}
- engines: {node: '>=v14.18.0'}
+ /vitest@1.0.0-beta.4(@types/node@20.9.0):
+ resolution: {integrity: sha512-WOJTqxY3hWqn4yy26SK+cx+BlPBeK/KtY9ALWkD6FLWLhSGY0QFEmarc8sdb/UGZQ8xs5pOvcQQS9JJSV8HH8g==}
+ engines: {node: ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
'@edge-runtime/vm': '*'
+ '@types/node': ^18.0.0 || >=20.0.0
'@vitest/browser': '*'
'@vitest/ui': '*'
happy-dom: '*'
jsdom: '*'
- playwright: '*'
- safaridriver: '*'
- webdriverio: '*'
peerDependenciesMeta:
'@edge-runtime/vm':
optional: true
+ '@types/node':
+ optional: true
'@vitest/browser':
optional: true
'@vitest/ui':
@@ -10074,21 +10064,13 @@ packages:
optional: true
jsdom:
optional: true
- playwright:
- optional: true
- safaridriver:
- optional: true
- webdriverio:
- optional: true
dependencies:
- '@types/chai': 4.3.10
- '@types/chai-subset': 1.3.5
'@types/node': 20.9.0
- '@vitest/expect': 0.34.6
- '@vitest/runner': 0.34.6
- '@vitest/snapshot': 0.34.6
- '@vitest/spy': 0.34.6
- '@vitest/utils': 0.34.6
+ '@vitest/expect': 1.0.0-beta.4
+ '@vitest/runner': 1.0.0-beta.4
+ '@vitest/snapshot': 1.0.0-beta.4
+ '@vitest/spy': 1.0.0-beta.4
+ '@vitest/utils': 1.0.0-beta.4
acorn: 8.11.2
acorn-walk: 8.3.0
cac: 6.7.14
@@ -10101,9 +10083,9 @@ packages:
std-env: 3.5.0
strip-literal: 1.3.0
tinybench: 2.5.1
- tinypool: 0.7.0
+ tinypool: 0.8.1
vite: 5.0.0(@types/node@20.9.0)
- vite-node: 0.34.6(@types/node@20.9.0)
+ vite-node: 1.0.0-beta.4(@types/node@20.9.0)
why-is-node-running: 2.2.2
transitivePeerDependencies:
- less
diff --git a/vitest.config.ts b/vitest.config.ts
index 9fe0a6b28d..fc76efbf88 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -29,6 +29,7 @@ export default defineConfig({
},
test: {
coverage: {
+ all: false,
provider: 'istanbul',
reporter: ['clover', 'json', 'lcov', 'text'],
},