Skip to content

Commit

Permalink
docs: clarify installing globally (#2397)
Browse files Browse the repository at this point in the history
* docs: install global

* chore: update

Co-authored-by: The Jared Wilcurt <TheJaredWilcurt@users.noreply.github.com>

* docs: npx help

* docs: update

* fix: error

Co-authored-by: The Jared Wilcurt <TheJaredWilcurt@users.noreply.github.com>
  • Loading branch information
poyoho and TheJaredWilcurt committed Dec 5, 2022
1 parent 1868f1c commit 2657ce5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/guide/index.md
Expand Up @@ -33,6 +33,10 @@ pnpm add -D vitest
Vitest requires Vite >=v3.0.0 and Node >=v14
:::

It is recommended that you install a copy of `vitest` in your `package.json`, using one of the methods listed above. However, if you would prefer to run `vitest` directly, you can use `npx vitest` (the `npx` command comes with npm and Node.js).

The `npx` command will executes command either from a local `node_modules/.bin` installing any packages needed in order for command to run. By default, npx will check whether command exists in $PATH, or in the local project binaries, and execute that. If command is not found, it will be installed prior to execution.

## Configuring Vitest

One of the main advantages of Vitest is its unified configuration with Vite. If present, `vitest` will read your root `vite.config.ts` to match with the plugins and setup as your Vite app. For example, your Vite [resolve.alias](https://vitejs.dev/config/shared-options.html#resolve-alias) and [plugins](https://vitejs.dev/guide/using-plugins.html) configuration will work out-of-the-box. If you want a different configuration during testing, you can:
Expand Down

0 comments on commit 2657ce5

Please sign in to comment.