question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`vi` as alias of `vitest`

See original GitHub issue
import { 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
antfucommented, Dec 16, 2021

https://github.com/antfu-sponsors/vitest/pull/163 implemented it and shipped in v91

1reaction
patak-devcommented, Dec 15, 2021

@Shinigami92 is this a positive or negative response to the issue? 😅

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found