From 009501d4be298d777a173f8f82e322158dd28255 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Fri, 17 Nov 2023 00:50:03 +0800 Subject: [PATCH] test: bump vitest to v1 beta --- package.json | 4 +- .../__snapshots__/codePlugin.spec.ts.snap | 202 +++++++++--------- .../importCodePlugin.spec.ts.snap | 4 +- pnpm-lock.yaml | 96 ++++----- vitest.config.ts | 1 + 5 files changed, 145 insertions(+), 162 deletions(-) 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
 }
-
 
 



" +
 
 



" `; exports[`@vuepress/markdown > plugins > codePlugin > :line-numbers / :no-line-numbers > should work properly if \`lineNumbers\` is enabled 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
 }
-
 
 



" +
 
 



" `; exports[`@vuepress/markdown > plugins > codePlugin > :line-numbers / :no-line-numbers > should work properly if \`lineNumbers\` is set to a number 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
 }
-
 
 



" +
 
 



" `; exports[`@vuepress/markdown > plugins > codePlugin > :v-pre / :no-v-pre > should work properly if \`vPre.block\` 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
 }
-
 
 



" +
 
 



" `; exports[`@vuepress/markdown > plugins > codePlugin > :v-pre / :no-v-pre > should work properly if \`vPre.block\` is enabled 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
 }
-
 
 



" +
 
 



" `; exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should disable \`highlightLines\` 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
@@ -206,23 +206,23 @@ function bar () {
 const baz = () => {
   return 2048
 }
-

{{ inlineCode }}

+

{{ inlineCode }}

" `; exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should disable \`lineNumbers\` 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
@@ -231,23 +231,23 @@ function bar () {
 const baz = () => {
   return 2048
 }
-
 
 
 
 
 




{{ inlineCode }}

+
 
 
 
 
 




{{ inlineCode }}

" `; exports[`@vuepress/markdown > plugins > codePlugin > plugin options > should disable \`preWrapper\` 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
@@ -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: