Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency vitest to v2 #1322

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"playwright": "1.46.0",
"prettier": "3.3.0",
"tree-kill": "^1.2.2",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"publishConfig": {
"access": "public",
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/tests/config/config-basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Should load config file', () => {
path.join(fixtureDir, 'rspress.config.cjs'),
);

expect(config).toContain({
expect(config).toMatchObject({
root: fixtureDir,
title: TEST_TITLE,
});
Expand All @@ -24,7 +24,7 @@ describe('Should load config file', () => {
path.join(fixtureDir, 'rspress.config.mjs'),
);

expect(config).toContain({
expect(config).toMatchObject({
// we need to normalize path as jiti will inject `__dirname` with posix separator in esm files
root: normalizePath(fixtureDir),
title: TEST_TITLE,
Expand All @@ -37,13 +37,13 @@ describe('Should load config file', () => {
path.join(fixtureDir, 'rspress.config.js'),
);

expect(config).toContain({
expect(config).toMatchObject({
root: fixtureDir,
title: TEST_TITLE,
});

config = await loadConfigFile(path.join(fixtureDir, 'rspress.config.ts'));
expect(config).toContain({
expect(config).toMatchObject({
root: normalizePath(fixtureDir),
title: TEST_TITLE,
});
Expand All @@ -59,9 +59,9 @@ describe('Should load config file', () => {
root: normalizePath(fixtureDir),
title: TEST_TITLE,
};
expect(config).toContain(expectConfig);
expect(config).toMatchObject(expectConfig);

config = await loadConfigFile(path.join(fixtureDir, 'rspress.config.ts'));
expect(config).toContain(expectConfig);
expect(config).toMatchObject(expectConfig);
});
});
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"rimraf": "^3.0.2",
"tailwindcss": "^3.4.3",
"typescript": "^5.5.3",
"vitest": "0.34.1",
"vitest": "2.0.5",
"webpack": "^5.93.0"
},
"sideEffects": [
Expand Down
34 changes: 17 additions & 17 deletions packages/core/src/node/route/RouteService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,22 @@ describe('RouteService', async () => {
expect(
routeService.generateRoutesCodeByRouteMeta(routeMeta, false),
).toMatchInlineSnapshot(`
"
import React from 'react';
import { lazyWithPreload } from \\"react-lazy-with-preload\\";
const Route0 = lazyWithPreload(() => import('/a.mdx'))
const Route1 = lazyWithPreload(() => import('/guide/b.mdx'))
export const routes = [
{ path: '/a', element: React.createElement(Route0), filePath: 'a.mdx', preload: async () => {
await Route0.preload();
return import(\\"/a.mdx\\");
}, lang: '', version: '' },
{ path: '/guide/b', element: React.createElement(Route1), filePath: 'guide/b.mdx', preload: async () => {
await Route1.preload();
return import(\\"/guide/b.mdx\\");
}, lang: '', version: '' }
];
"
`);
"
import React from 'react';
import { lazyWithPreload } from "react-lazy-with-preload";
const Route0 = lazyWithPreload(() => import('/a.mdx'))
const Route1 = lazyWithPreload(() => import('/guide/b.mdx'))
export const routes = [
{ path: '/a', element: React.createElement(Route0), filePath: 'a.mdx', preload: async () => {
await Route0.preload();
return import("/a.mdx");
}, lang: '', version: '' },
{ path: '/guide/b', element: React.createElement(Route1), filePath: 'guide/b.mdx', preload: async () => {
await Route1.preload();
return import("/guide/b.mdx");
}, lang: '', version: '' }
];
"
`);
});
});
32 changes: 16 additions & 16 deletions packages/core/tests/__snapshots__/prismLanguages.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

exports[`automatic import of prism languages > prism languages aliases should be configurable to users 1`] = `
"export const aliases = {
\\"javascript\\": [
\\"js\\"
"javascript": [
"js"
],
\\"objectivec\\": [
\\"oc\\"
"objectivec": [
"oc"
],
\\"tsx\\": [
\\"jsx\\"
"tsx": [
"jsx"
]
};
export const languages = {
\\"javascript\\": require(
\\"react-syntax-highlighter/dist/cjs/languages/prism/javascript\\"
).default,\\"objectivec\\": require(
\\"react-syntax-highlighter/dist/cjs/languages/prism/objectivec\\"
).default,\\"rust\\": require(
\\"react-syntax-highlighter/dist/cjs/languages/prism/rust\\"
).default,\\"tsx\\": require(
\\"react-syntax-highlighter/dist/cjs/languages/prism/tsx\\"
).default,\\"typescript\\": require(
\\"react-syntax-highlighter/dist/cjs/languages/prism/typescript\\"
"javascript": require(
"react-syntax-highlighter/dist/cjs/languages/prism/javascript"
).default,"objectivec": require(
"react-syntax-highlighter/dist/cjs/languages/prism/objectivec"
).default,"rust": require(
"react-syntax-highlighter/dist/cjs/languages/prism/rust"
).default,"tsx": require(
"react-syntax-highlighter/dist/cjs/languages/prism/tsx"
).default,"typescript": require(
"react-syntax-highlighter/dist/cjs/languages/prism/typescript"
).default
}"
`;
2 changes: 1 addition & 1 deletion packages/modern-plugin-rspress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.5.3",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"sideEffects": [
"**/*.scss"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-auto-nav-sidebar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"typescript": "^5.5.3",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"sideEffects": [
"*.css",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-client-redirects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"typescript": "^5.5.3",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"peerDependencies": {
"@rspress/runtime": "workspace:^1.27.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`remark-container > Has space before ::: 1`] = `
"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">title</div><div class=\\"rspress-directive-content\\"><p>
"<div class="rspress-directive tip"><div class="rspress-directive-title">title</div><div class="rspress-directive-content"><p>
sss</p></div></div>"
`;

exports[`remark-container > Has space before type 1`] = `"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>This is a tip.</p></div></div>"`;
exports[`remark-container > Has space before type 1`] = `"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>This is a tip.</p></div></div>"`;

exports[`remark-container > No newline 1`] = `
"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>
"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>
This is a tip</p></div></div>
<p>12312</p>"
`;

exports[`remark-container > Use {title="foo"} as title 1`] = `"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">Custom title</div><div class=\\"rspress-directive-content\\"><p>This is a tip.</p></div></div>"`;
exports[`remark-container > Use {title="foo"} as title 1`] = `"<div class="rspress-directive tip"><div class="rspress-directive-title">Custom title</div><div class="rspress-directive-content"><p>This is a tip.</p></div></div>"`;

exports[`remark-container > Use {title='foo'} as title 1`] = `"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">Custom title</div><div class=\\"rspress-directive-content\\"><p>This is a tip.</p></div></div>"`;
exports[`remark-container > Use {title='foo'} as title 1`] = `"<div class="rspress-directive tip"><div class="rspress-directive-title">Custom title</div><div class="rspress-directive-content"><p>This is a tip.</p></div></div>"`;

exports[`remark-container > Use {title=foo} as title 1`] = `"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">Custom title</div><div class=\\"rspress-directive-content\\"><p>This is a tip.</p></div></div>"`;
exports[`remark-container > Use {title=foo} as title 1`] = `"<div class="rspress-directive tip"><div class="rspress-directive-title">Custom title</div><div class="rspress-directive-content"><p>This is a tip.</p></div></div>"`;

exports[`remark-container > With a new line after the start position of container 1`] = `"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>This is a tip</p></div></div>"`;
exports[`remark-container > With a new line after the start position of container 1`] = `"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>This is a tip</p></div></div>"`;

exports[`remark-container > With block quote in container 1`] = `
"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>This is a tip with <code>code</code> and <a href=\\"foo\\">link</a> some text</p><blockquote>
"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>This is a tip with <code>code</code> and <a href="foo">link</a> some text</p><blockquote>
<p>This is a quote</p>
</blockquote></div></div>"
`;

exports[`remark-container > With code block in container 1`] = `
"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>This is a tip with <code>code</code> and <a href=\\"foo\\">link</a> some text</p><pre><code class=\\"language-js\\">const a = 1;
"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>This is a tip with <code>code</code> and <a href="foo">link</a> some text</p><pre><code class="language-js">const a = 1;
</code></pre></div></div>"
`;

exports[`remark-container > With link, inlineCode, img, list in container 1`] = `
"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>This is a tip with <code>code</code> and <a href=\\"foo\\">link</a> some text</p><ul>
"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>This is a tip with <code>code</code> and <a href="foo">link</a> some text</p><ul>
<li>list 1</li>
<li>list 2</li>
</ul><p><img src=\\"foo\\" alt=\\"img\\"></p></div></div>"
</ul><p><img src="foo" alt="img"></p></div></div>"
`;

exports[`remark-container > With new line before the end position of container 1`] = `
"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>
"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>
This is a tip</p></div></div>"
`;

exports[`remark-container > With new line in all case 1`] = `"<div class=\\"rspress-directive tip\\"><div class=\\"rspress-directive-title\\">TIP</div><div class=\\"rspress-directive-content\\"><p>This is a tip</p></div></div>"`;
exports[`remark-container > With new line in all case 1`] = `"<div class="rspress-directive tip"><div class="rspress-directive-title">TIP</div><div class="rspress-directive-content"><p>This is a tip</p></div></div>"`;

exports[`remark-container > details 1`] = `
"<details class=\\"rspress-directive details\\"><summary class=\\"rspress-directive-title\\">DETAILS</summary><div class=\\"rspress-directive-content\\"><p>
"<details class="rspress-directive details"><summary class="rspress-directive-title">DETAILS</summary><div class="rspress-directive-content"><p>
This is a details block.</p></div></details>"
`;
2 changes: 1 addition & 1 deletion packages/plugin-last-updated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"typescript": "^5.5.3",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"dependencies": {
"@rspress/shared": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-medium-zoom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"typescript": "^5.5.3",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"peerDependencies": {
"@rspress/runtime": "workspace:^1.27.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"react": "^18.3.1",
"typescript": "^5.5.3",
"unified": "^10.1.2",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"sideEffects": [
"*.css",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-typedoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"typescript": "^5.5.3",
"vitest": "0.34.1"
"vitest": "2.0.5"
},
"peerDependencies": {
"rspress": "workspace:^1.27.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/theme-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"gray-matter": "4.0.3",
"tailwindcss": "^3.4.3",
"typescript": "^5.5.3",
"vitest": "0.34.1",
"vitest": "2.0.5",
"webpack": "^5.93.0"
},
"sideEffects": [
Expand Down
Loading