From a11d565422e7b6ca9557b686b5a9d299d5e726ba Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Wed, 4 Dec 2024 20:41:35 +0100 Subject: [PATCH] docs: replace
with ::: details --- docs/config/index.md | 6 ++---- docs/guide/improving-performance.md | 6 ++---- docs/guide/in-source.md | 14 ++++---------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/docs/config/index.md b/docs/config/index.md index 6f0d27ced2d0..cdf686c4ba83 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -12,9 +12,7 @@ If you are using Vite and have a `vite.config` file, Vitest will read it to matc To configure `vitest` itself, add `test` property in your Vite config. You'll also need to add a reference to Vitest types using a [triple slash command](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-) at the top of your config file, if you are importing `defineConfig` from `vite` itself. -
- Open Config Examples - +::: details Open Config Examples Using `defineConfig` from `vite` you should follow this: ```ts [vite.config.js] @@ -93,7 +91,7 @@ export default defineConfig(configEnv => mergeConfig( }) )) ``` -
+::: ::: warning _All listed options_ on this page are located within a `test` property inside the configuration: diff --git a/docs/guide/improving-performance.md b/docs/guide/improving-performance.md index eccba4529f93..9c25fcd44cdd 100644 --- a/docs/guide/improving-performance.md +++ b/docs/guide/improving-performance.md @@ -91,9 +91,7 @@ Collect the results stored in `.vitest-reports` directory from each machine and vitest --merge-reports ``` -
- Github action example - +::: details Github action example This setup is also used at https://github.com/vitest-tests/test-sharding. ```yaml @@ -162,7 +160,7 @@ jobs: run: npx vitest --merge-reports ``` -
+::: :::tip Test sharding can also become useful on high CPU-count machines. diff --git a/docs/guide/in-source.md b/docs/guide/in-source.md index 9a9c2507fbf0..3864d7a088d1 100644 --- a/docs/guide/in-source.md +++ b/docs/guide/in-source.md @@ -70,9 +70,7 @@ export default defineConfig({ ### Other Bundlers -
-unbuild - +::: details unbuild ```ts [build.config.ts] import { defineBuildConfig } from 'unbuild' @@ -85,12 +83,9 @@ export default defineBuildConfig({ ``` Learn more: [unbuild](https://github.com/unjs/unbuild) +::: -
- -
-Rollup - +::: details Rollup ```ts [rollup.config.js] import replace from '@rollup/plugin-replace' // [!code ++] @@ -105,8 +100,7 @@ export default { ``` Learn more: [Rollup](https://rollupjs.org/) - -
+::: ## TypeScript