`vi` as alias of `vitest`
See original GitHub issueimport { vi } from 'vitest'
vi.fn()
vi.mock()
Reads like vi-test, vi-fn, vi-mock
We are going to use the vi.fn() form in the docs, and mention that vitest is an alias in case users prefer the more explicit vitest.fn()
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Configuring Vitest
Define custom aliases when running inside tests. They will be merged with aliases from resolve.alias . globals #. Type: boolean; Default: false.
Read more >unable to alias modules using Vitest/Vite · Issue #1638 - GitHub
Describe the bug I am replacing my old Jest tests with Vitest (awesome work btw) but I am unable to alias a module...
Read more >Vitest - @ src folder alias not resolved in test files
You just have to specify the aliases in you're vitest.config.js file: import path from 'path' import vue from '@vitejs/plugin-vue' export ...
Read more >Vitest + Inertia.js errors when running tests on Page ...
I have setup my project with Laravel + Inertia.js + Vite + Vitest - and everything works fine ... import { assert, describe,...
Read more >Test Svelte Component Using Vitest & Playwright - David Peng
Resources. Discussion. sveltejs/kit: Vitest for unit testing #5285. Issues. Shim SvelteKit runtime import aliases / Importing $app/* fails ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

https://github.com/antfu-sponsors/vitest/pull/163 implemented it and shipped in v91
@Shinigami92 is this a positive or negative response to the issue? 😅