Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/vitest-dev/vitest
/ functions
Functions
4,532 in github.com/vitest-dev/vitest
⨍
Functions
4,532
◇
Types & classes
1,222
↓ 15 callers
Method
next
()
packages/vitest/src/runtime/runner/utils/tags.ts:174
↓ 15 callers
Function
openExplorerItem
(page: Page, name: string)
test/ui/test/helper.ts:72
↓ 15 callers
Method
resolve
(value: unknown)
packages/vitest/src/node/pools/poolRunner.ts:433
↓ 14 callers
Function
cleanUrl
(url: string)
packages/utils/src/helpers.ts:64
↓ 14 callers
Function
createDtsUtils
({ isolatedDeclDir = '.types', cleanupDir = '.types', } = {})
scripts/build-utils.js:7
↓ 14 callers
Method
findElement
* This method returns an element matching the locator. * Unlike [`.element()`](https://vitest.dev/api/browser/locators#element), * this method w
packages/browser/context.d.ts:786
↓ 14 callers
Function
fn
()
test/unit/test/jest-mock.test.ts:102
↓ 14 callers
Method
frameLocator
* The iframe locator. This is a document locator that enters the iframe body * and works similarly to the `page` object. * * As the first arg
packages/browser/context.d.ts:911
↓ 14 callers
Method
getProjectByName
(name: string)
packages/vitest/src/node/core.ts:614
↓ 14 callers
Function
getWorkerState
()
packages/vitest/src/runtime/utils.ts:10
↓ 14 callers
Function
isBuiltin
(id: string)
packages/vitest/src/utils/modules.ts:17
↓ 14 callers
Method
mockRestore
* Does what `mockReset` does and restores original descriptors of spied-on objects. * @see https://vitest.dev/api/mock#mockrestore
packages/spy/src/types.ts:247
↓ 14 callers
Function
printer
( val: unknown, config: Config, indentation: string, depth: number, refs: Refs, hasCalledToJSON?:
packages/pretty-format/src/index.ts:380
↓ 14 callers
Function
processError
( _err: any, diffOptions?: DiffOptions, seen: WeakSet<WeakKey> = new WeakSet(), )
packages/utils/src/error.ts:9
↓ 14 callers
Method
resolve
(id: string, options?: { paths?: string[] })
packages/vitest/src/runtime/vm/commonjs-executor.ts:280
↓ 14 callers
Method
useFakeTimers
()
packages/vitest/src/integrations/mock/timers.ts:148
↓ 13 callers
Method
_checkFakeTimers
()
packages/vitest/src/integrations/mock/timers.ts:258
↓ 13 callers
Method
allTests
* Filters all tests that are part of this collection and its children.
packages/vitest/src/node/reporters/reported-tasks.ts:298
↓ 13 callers
Function
createDefer
()
packages/utils/src/helpers.ts:281
↓ 13 callers
Function
createVitest
( modeOrOptions: VitestRunMode | CliOptions, optionsOrViteOverrides: CliOptions | ViteUserConfig = {}, v
packages/vitest/src/node/create.ts:27
↓ 13 callers
Method
get
(id: string)
packages/mocker/src/registry.ts:142
↓ 13 callers
Function
getConfig
()
packages/browser/src/client/utils.ts:33
↓ 13 callers
Method
getOwnPropertyDescriptor
()
packages/vitest/src/runtime/vm/commonjs-executor.ts:320
↓ 13 callers
Method
mockImplementation
* Accepts a function to be used as the mock implementation. TypeScript expects the arguments and return type to match those of the original function.
packages/spy/src/types.ts:263
↓ 13 callers
Method
nth
* Returns a locator for the nth element matching the selector. * @see {@link https://vitest.dev/api/browser/locators#nth}
packages/browser/context.d.ts:747
↓ 13 callers
Function
runVitestCli
(_options?: CliOptions | string, ...args: string[])
test/test-utils/index.ts:529
↓ 12 callers
Function
assert
(condition: any, message: string)
packages/vitest/src/runtime/runner/suite.ts:193
↓ 12 callers
Method
catchError
(error: unknown, type: string)
packages/vitest/src/node/state.ts:62
↓ 12 callers
Method
meta
* Custom metadata that was attached to the test during its execution.
packages/vitest/src/node/reporters/reported-tasks.ts:66
↓ 12 callers
Function
readFile
({ project }, path, options = {})
packages/browser/src/node/commands/fs.ts:10
↓ 12 callers
Method
resolve
(relativePath: string)
packages/vitest/src/node/benchmark.ts:14
↓ 12 callers
Function
testTree
(module: TestModule | TestSuite, tree: any = {}, fnFn?: boolean)
test/e2e/test/static-collect.test.ts:1712
↓ 11 callers
Function
convertToLocator
(element: Element | Locator)
packages/browser/src/client/tester/context.ts:462
↓ 11 callers
Method
createSpecification
* Creates a new test specification. Specifications describe how to run tests. * @param moduleId The file path
packages/vitest/src/node/project.ts:162
↓ 11 callers
Method
equals
(other: AnagramComparator)
test/unit/test/expect.test.ts:56
↓ 11 callers
Function
getDescribedLocator
( context: BrowserCommandContext, { locator, selector }: SerializedLocator, )
packages/browser-playwright/src/commands/utils.ts:18
↓ 11 callers
Function
getMessage
( context: MatcherState, matcher: string, expectedLabel: string, expectedValue: unknown, receivedLab
packages/browser/src/client/tester/expect/utils.ts:86
↓ 11 callers
Function
getSafeTimers
()
packages/utils/src/timers.ts:23
↓ 11 callers
Function
isParentNode
(node: UITaskTreeNode)
packages/ui/client/composables/explorer/utils.ts:27
↓ 11 callers
Method
normalizeFilename
(module: TestModule)
test/e2e/test/reporters/test-run.test.ts:1229
↓ 11 callers
Method
off
(event: 'message' | 'error', callback: (arg: any) => void)
packages/vitest/src/node/pools/poolRunner.ts:356
↓ 11 callers
Method
resetOutput
()
test/test-utils/cli.ts:59
↓ 11 callers
Method
send
(method: string, params?: Record<string, unknown>)
packages/browser/src/node/cdp.ts:14
↓ 11 callers
Function
slash
(path: string)
packages/utils/src/helpers.ts:59
↓ 11 callers
Function
state
()
packages/vitest/src/runtime/moduleRunner/startVitestModuleRunner.ts:42
↓ 11 callers
Function
sum
(a: number, b: number)
test/coverage-test/fixtures/src/math.ts:1
↓ 11 callers
Method
toHaveTextContent
* @description * Validate that the given element's text content matches the provided string exactly. * * Supports elements, but also text nod
packages/browser/jest-dom.d.ts:395
↓ 11 callers
Method
toReportPassedTest
(testName: string, testProject?: string | BrowserInstanceOption[])
test/browser/setup.unit.ts:59
↓ 10 callers
Method
assert
(options: AssertOptions)
packages/snapshot/src/client.ts:203
↓ 10 callers
Function
assertBrowserFileAccess
(project: TestProject, path: string)
packages/browser/src/node/utils.ts:100
↓ 10 callers
Function
assertTypes
( value: unknown, name: string, types: string[], )
packages/utils/src/helpers.ts:39
↓ 10 callers
Method
collectFiles
(project: TestProject, files: File[] = [])
packages/vitest/src/node/state.ts:150
↓ 10 callers
Function
defineProject
(config: UserProjectConfigExport)
packages/vitest/src/public/config.ts:61
↓ 10 callers
Function
equals
( a: unknown, b: unknown, customTesters?: Array<Tester>, strictCheck?: boolean, )
packages/expect/src/jest-utils.ts:31
↓ 10 callers
Function
findById
(id: string)
packages/ui/client/composables/client/index.ts:98
↓ 10 callers
Method
get
(suite: Suite)
packages/vitest/src/runtime/runner/fixture.ts:70
↓ 10 callers
Function
getCurrentSuite
()
packages/vitest/src/runtime/runner/suite.ts:242
↓ 10 callers
Method
getSnapshotState
(filepath: string)
packages/snapshot/src/client.ts:107
↓ 10 callers
Function
getTag
(element: Element)
packages/browser/src/client/tester/expect/utils.ts:212
↓ 10 callers
Method
getUnhandledErrors
()
packages/vitest/src/node/state.ts:100
↓ 10 callers
Function
parse
(code: string, options: any)
test/unit/test/injector-esm.test.ts:5
↓ 10 callers
Method
serialize
* Returns a JSON-serializable representation of the locator with two fields: * - `selector`: the provider-specific selector string used to query th
packages/browser/context.d.ts:610
↓ 10 callers
Function
test
packages/snapshot/src/port/mockSerializer.ts:47
↓ 10 callers
Method
toBeInTheDocument
* @description * Assert whether an element is present in the document or not. * @example * <svg data-testid="svg-element"></svg> * * aw
packages/browser/jest-dom.d.ts:17
↓ 10 callers
Function
toElement
(element: Element | Locator)
packages/browser/src/client/tester/context.ts:156
↓ 10 callers
Method
write
(data: string)
test/test-utils/cli.ts:48
↓ 9 callers
Function
assert
(condition: any, message: string)
packages/spy/src/index.ts:463
↓ 9 callers
Method
cancelCurrentRun
* Gracefully cancel the current test run. Vitest will wait until all running tests are finished before cancelling.
packages/vitest/src/node/core.ts:1263
↓ 9 callers
Method
diagnostic
* Useful information about the test like duration, memory usage, etc. * Diagnostic is only available after the test has finished.
packages/vitest/src/node/reporters/reported-tasks.ts:230
↓ 9 callers
Function
getDefaultHookTimeout
()
packages/vitest/src/runtime/runner/hooks.ts:26
↓ 9 callers
Method
mockClear
* Clears all information about every call. After calling it, all properties on `.mock` will return to their initial state. This method does not reset
packages/spy/src/types.ts:232
↓ 9 callers
Method
resolveId
(rawId: string, importer?: string)
packages/vitest/src/runtime/moduleRunner/bareModuleMocker.ts:101
↓ 9 callers
Method
send
(request: WorkerRequest)
test/e2e/fixtures/custom-pool/pool/custom-pool.ts:30
↓ 9 callers
Method
setup
( filepath: string, options: SnapshotStateOptions, )
packages/snapshot/src/client.ts:77
↓ 9 callers
Function
x
()
test/unit/test/strict.test.js:19
↓ 8 callers
Method
advanceTimersByTime
(msToRun: number)
packages/vitest/src/integrations/mock/timers.ts:112
↓ 8 callers
Function
assertTestCounts
(page: Page, { pass, fail, skip = 0 }: { pass: number; fail: number; skip?: number })
test/ui/test/helper.ts:59
↓ 8 callers
Function
checkFileAccess
(path: string)
packages/browser/src/node/rpc.ts:167
↓ 8 callers
Function
deepMerge
( target: T, ...sources: any[] )
packages/utils/src/helpers.ts:395
↓ 8 callers
Function
ensureAwaited
(promise: (error?: Error) => Promise<T>)
packages/browser/src/client/utils.ts:37
↓ 8 callers
Function
errorBanner
(message: string)
packages/vitest/src/node/reporters/renderers/utils.ts:41
↓ 8 callers
Method
first
* Returns a locator for the first element matching the selector. * @see {@link https://vitest.dev/api/browser/locators#first}
packages/browser/context.d.ts:752
↓ 8 callers
Function
formatProjectName
(project?: Pick<TestProject, 'name' | 'color'>, suffix = ' ')
packages/vitest/src/node/reporters/renderers/utils.ts:227
↓ 8 callers
Function
formatTime
(time: number)
packages/vitest/src/node/reporters/renderers/utils.ts:220
↓ 8 callers
Method
get
(mod, prop)
packages/vitest/src/runtime/moduleRunner/moduleEvaluator.ts:171
↓ 8 callers
Method
getMockName
* Use it to return the name assigned to the mock with the `.mockName(name)` method. By default, it will return `vi.fn()`. * @see https://vitest.dev
packages/spy/src/types.ts:216
↓ 8 callers
Method
getSession
(sessionId: string)
packages/vitest/src/node/browser/sessions.ts:11
↓ 8 callers
Method
globTestSpecifications
* Glob test files in every project and create a TestSpecification for each file and pool. * @param filters String filters to match the test files.
packages/vitest/src/node/core.ts:650
↓ 8 callers
Function
isA
(typeName: string, value: unknown)
packages/expect/src/jest-utils.ts:317
↓ 8 callers
Function
log
(...args: string[])
packages/vitest/src/node/cli/doctor.ts:172
↓ 8 callers
Method
onCancel
* Register a handler that will be called when the test run is cancelled with `vitest.cancelCurrentRun`.
packages/vitest/src/node/core.ts:1711
↓ 8 callers
Method
once
(event: string, listener: string)
packages/browser/src/node/cdp.ts:51
↓ 8 callers
Function
parseStacktrace
( stack: string, options: StackTraceParserOptions = {}, )
packages/utils/src/source-map.ts:229
↓ 8 callers
Function
readFile
(filename, encoding = 'utf8')
packages/vitest/src/node/reporters/report.ts:116
↓ 8 callers
Function
relative
(stdout: string)
test/e2e/test/list.test.ts:285
↓ 8 callers
Method
rerunFiles
@internal
packages/vitest/src/node/core.ts:1283
↓ 8 callers
Method
reset
()
packages/mocker/src/types.ts:57
↓ 8 callers
Method
resolveId
(id: string, importer?: string)
packages/mocker/src/node/resolver.ts:61
↓ 8 callers
Method
schedule
* Queue new render update
packages/vitest/src/node/reporters/renderers/windowedRenderer.ts:99
↓ 8 callers
Method
screenshot
* Make a screenshot of an element matching the locator. * @see {@link https://vitest.dev/api/browser/locators#screenshot}
packages/browser/context.d.ts:699
← previous
next →
101–200 of 4,532, ranked by callers