···223223- **Default:** `true`
224224- **Alias:** [`test.sequential`](#test-sequential)
225225226226-Whether tests run sequentially. When both `concurrent` and `sequential` are specified, `concurrent` takes precendence.
226226+Whether tests run sequentially. When both `concurrent` and `sequential` are specified, `concurrent` takes precedence.
227227228228### skip
229229
+1-1
docs/config/environment.md
···8282```
83838484::: tip
8585-The `viteEnvironment` field corresponde to the environment defined by the [Vite Environment API](https://vite.dev/guide/api-environment#environment-api). By default, Vite exposes `client` (for the browser) and `ssr` (for the server) environments.
8585+The `viteEnvironment` field corresponds to the environment defined by the [Vite Environment API](https://vite.dev/guide/api-environment#environment-api). By default, Vite exposes `client` (for the browser) and `ssr` (for the server) environments.
8686:::
87878888Vitest also exposes `builtinEnvironments` through `vitest/environments` entry, in case you just want to extend it. You can read more about extending environments in [our guide](/guide/environment).
+1-1
docs/config/experimental.md
···336336- `istanbul` coverage provider doesn't work because there is no transformation phase, use `v8` instead
337337338338::: warning Coverage Support
339339-At the momemnt Vitest supports coverage via `v8` provider as long as files can be transformed into JavaScript. To transform TypeScript, Vitest uses [`module.stripTypeScriptTypes`](https://nodejs.org/api/module.html#modulestriptypescripttypescode-options) which is available in Node.js since v22.13. If you are using a custom [module loader](https://nodejs.org/api/module.html#customization-hooks), Vitest is not able to reuse it to transform files for analysis.
339339+At the moment Vitest supports coverage via `v8` provider as long as files can be transformed into JavaScript. To transform TypeScript, Vitest uses [`module.stripTypeScriptTypes`](https://nodejs.org/api/module.html#modulestriptypescripttypescode-options) which is available in Node.js since v22.13. If you are using a custom [module loader](https://nodejs.org/api/module.html#customization-hooks), Vitest is not able to reuse it to transform files for analysis.
340340:::
341341342342With regards to mocking, it is also important to point out that ES modules do not support property override. This means that code like this won't work anymore:
···102102Tags can define [test options](/api/test#test-options) that will be applied to every test marked with the tag. These options are merged with the test's own options, with the test's options taking precedence.
103103104104::: warning
105105-The [`retry.condition`](/api/test#retry) can onle be a regexp because the config values need to be serialised.
105105+The [`retry.condition`](/api/test#retry) can only be a regexp because the config values need to be serialised.
106106107107Tags also cannot apply other [tags](/api/test#tags) via these options.
108108:::
+1-1
test/core/vite.config.ts
···3333 }
3434 },
3535 },
3636- // Use babel plugin since Oxc (Vite 8) doens't support ecma decorators out of the box
3636+ // Use babel plugin since Oxc (Vite 8) doesn't support ecma decorators out of the box
3737 // https://github.com/oxc-project/oxc/issues/9170#issuecomment-4072166491
3838 !!rolldownVersion
3939 && (import('@rolldown/plugin-babel').then(({ default: babel }) =>
+1-1
test/test-utils/index.ts
···177177 ...rest.env,
178178 ...cliOptions?.env,
179179 },
180180- // override cache config with the one that was used to run `vitest` formt the CLI
180180+ // override cache config with the one that was used to run `vitest` from the CLI
181181 experimental: {
182182 fsModuleCache: rest.experimental?.fsModuleCache ?? currentConfig.experimental.fsModuleCache,
183183 ...cliOptions?.experimental,
+1-1
docs/api/advanced/runner.md
···198198}
199199```
200200201201-Every task has a `suite` property that references a suite it is located in. If `test` or `describe` are initiated at the top level, they will not have a `suite` property (it will **not** be equal to `file`!). `File` also never has a `suite` property. It is useful to travers the tasks from the bottom up.
201201+Every task has a `suite` property that references a suite it is located in. If `test` or `describe` are initiated at the top level, they will not have a `suite` property (it will **not** be equal to `file`!). `File` also never has a `suite` property. It is useful to traverse the tasks from the bottom up.
202202203203```ts
204204interface Test<ExtraContext = object> extends TaskBase {
···241241```ts
242242export const utils: {
243243 /**
244244- * This is simillar to calling `page.elementLocator`, but it returns only
244244+ * This is similar to calling `page.elementLocator`, but it returns only
245245 * locator selectors.
246246 */
247247 getElementLocatorSelectors(element: Element): LocatorSelectors
+1-1
docs/config/browser/playwright.md
···164164When enabled, Vitest uses Playwright's [persistent context](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context) instead of a regular browser context. This allows browser state (cookies, localStorage, DevTools settings, etc.) to persist between test runs.
165165166166::: warning
167167-This option is ignored when running tests in parallel (e.g. when headless with [`fileParallelism`](/config/fileparallelism) enalbed) since persistent context cannot be shared across parallel sessions.
167167+This option is ignored when running tests in parallel (e.g. when headless with [`fileParallelism`](/config/fileparallelism) enabled) since persistent context cannot be shared across parallel sessions.
168168:::
169169170170- When set to `true`, the user data is stored in `./node_modules/.cache/vitest-playwright-user-data`
+1-1
docs/guide/mocking/classes.md
···154154:::
155155156156::: danger
157157-Using classes with `vi.fn()` was introduced in Vitest 4. Previously, you had to use `function` and `prototype` inheritence directly. See [v3 guide](https://v3.vitest.dev/guide/mocking.html#classes).
157157+Using classes with `vi.fn()` was introduced in Vitest 4. Previously, you had to use `function` and `prototype` inheritance directly. See [v3 guide](https://v3.vitest.dev/guide/mocking.html#classes).
158158:::
···482482 const p = runner.onTaskUpdate?.(taskPacks, eventsPacks)
483483 if (p) {
484484 pendingTasksUpdates.push(p)
485485- // remove successful promise to not grow array indefnitely,
485485+ // remove successful promise to not grow array indefinitely,
486486 // but keep rejections so finishSendTasksUpdate can handle them
487487 p.then(
488488 () => pendingTasksUpdates.splice(pendingTasksUpdates.indexOf(p), 1),
+3-3
packages/spy/src/index.ts
···245245 originalImplementation?: T,
246246): Mock<T> {
247247 // if the function is already a mock, just return the same function,
248248- // simillarly to how vi.spyOn() works
248248+ // similarly to how vi.spyOn() works
249249 if (originalImplementation != null && isMockFunction(originalImplementation)) {
250250 return originalImplementation as Mock<T>
251251 }
···485485486486 // jest calls this before the implementation, but we have to resolve this _after_
487487 // because we cannot do it before the `Reflect.construct` called the custom implementation.
488488- // fortunetly, the constructor is always an empty functon because `prototypeMethods`
488488+ // fortunately, the constructor is always an empty function because `prototypeMethods`
489489 // are only used by the automocker, so this doesn't matter
490490 for (const prop of prototypeMembers) {
491491 const prototypeMock = returnValue[prop]
492492- // the method was overidden because of inheritence, ignore it
492492+ // the method was overridden because of inheritance, ignore it
493493 // eslint-disable-next-line ts/no-use-before-define
494494 if (prototypeMock !== mock.prototype[prop]) {
495495 continue
+1-1
test/browser/specs/runner.test.ts
···241241 expect(stderr).toContain('Failure screenshot')
242242 expect(stderr).toContain('__screenshots__/failing')
243243244244- expect(stderr).toContain('Access denied to "/inaccesible/path".')
244244+ expect(stderr).toContain('Access denied to "/inaccessible/path".')
245245246246 // depending on the browser it references either `.toBe()` or `expect()`
247247 expect(stderr).toMatch(/failing.test.ts:11:(12|17)/)
+1-1
test/browser/test/findElement.test.ts
···3232 return locator.findElement({ timeout: 100 })
3333 }).rejects.toThrow('Cannot find element with locator: getByRole(\'button\')')
3434 // Normally it would be 5:
3535- // Immidiate, 0 (next tick), 20, 50, 100
3535+ // Immediate, 0 (next tick), 20, 50, 100
3636 // But on CI it can be less because resources are limited
3737 expect(elementsSpy.mock.calls.length).toBeGreaterThanOrEqual(3)
3838})
+1-1
test/cli/test/mocking.test.ts
···5555 root: path.join(import.meta.dirname, '../fixtures/invalid-package'),
5656 })
57575858- // requires Vite 8 for relaxed import analysis validataion
5858+ // requires Vite 8 for relaxed import analysis validation
5959 // https://github.com/vitejs/vite/pull/21601
6060 if (rolldownVersion) {
6161 expect(stderr).toMatchInlineSnapshot(`""`)
···175175176176 spy.mockRestore()
177177178178- // Sicne Vitest 4 this is a special case where
178178+ // Since Vitest 4 this is a special case where
179179 // vi.fn(impl) will always return impl, unless overridden
180180 expect(spy.getMockImplementation()).toBe(originalFn)
181181
+1-1
test/coverage-test/test/file-outside-vite.test.ts
···2323 }
2424 else {
2525 // On istanbul the instrumentation happens on Vite plugin, so files
2626- // loaded outsite Vite should have 0% coverage
2626+ // loaded outside Vite should have 0% coverage
2727 expect(fileCoverage).toMatchInlineSnapshot(`
2828 {
2929 "branches": "0/0 (100%)",
+1-1
packages/browser/src/node/plugin.ts
···334334 },
335335 transform(code, id) {
336336 if (id.includes(parentServer.vite.config.cacheDir) && id.includes('loupe.js')) {
337337- // loupe bundle has a nastry require('util') call that leaves a warning in the console
337337+ // loupe bundle has a nasty require('util') call that leaves a warning in the console
338338 const utilRequire = 'nodeUtil = require_util();'
339339 return code.replace(utilRequire, ' '.repeat(utilRequire.length))
340340 }
+1-1
packages/ui/client/composables/navigation.ts
···160160 // TODO: find a way to make this universal - maybe show browser separately(?)
161161 if (browserState?.provider === 'webdriverio') {
162162 const parentWindow = window.outerWidth * (panels.details.size / 100)
163163- // 40 is 20px padding for each sice
163163+ // 40 is 20px padding for each side
164164 const tabWidth = ((viewport.value[0] + 20) / parentWindow) * 100
165165 return tabWidth
166166 }
+1-1
packages/vitest/src/api/setup.ts
···142142 }
143143 catch {}
144144145145- // TODO: store this in HTML reporter separetly
145145+ // TODO: store this in HTML reporter separately
146146 const transformDuration = ctx.state.metadata[projectName]?.duration[moduleNode.url]?.[0]
147147 if (transformDuration != null) {
148148 result.transformTime = transformDuration
+1-1
packages/vitest/src/node/state.ts
···256256 }
257257258258 cancelFiles(files: FileSpecification[], project: TestProject): void {
259259- // if we don't filter existing modules, they will be overriden by `collectFiles`
259259+ // if we don't filter existing modules, they will be overridden by `collectFiles`
260260 const nonRegisteredFiles = files.filter(({ filepath }) => {
261261 const relativePath = relative(project.config.root, filepath)
262262 const id = generateFileHash(relativePath, project.name)
···124124 })
125125126126 // https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData#exceptions
127127- test('cannot pass down form data from a FORM element with a non-sumbit sumbitter', async () => {
127127+ test('cannot pass down form data from a FORM element with a non-submit submitter', async () => {
128128 const form = document.createElement('form')
129129 document.body.append(form)
130130 const submitter = document.createElement('button')
···136136 )
137137 })
138138139139- test('cannot pass down form data from a FORM element with a sumbitter from a wrong form', async () => {
139139+ test('cannot pass down form data from a FORM element with a submitter from a wrong form', async () => {
140140 const form1 = document.createElement('form')
141141 const form2 = document.createElement('form')
142142 document.body.append(form1, form2)
+1-1
test/core/test/mocking/vi-fn.test-d.ts
···6868 expectTypeOf(Mock).constructorParameters.toEqualTypeOf<[a: string, b?: number]>()
6969})
70707171-test('cann call a function mock with and without new', () => {
7171+test('can call a function mock with and without new', () => {
7272 const Mock = vi.fn(function fn(this: any) {
7373 this.test = true
7474 })
+1-1
test/coverage-test/fixtures/src/ignore-hints.ts
···1414}
15151616export function fourth() {
1717- return "fourh"
1717+ return "fourth"
1818}
1919/* istanbul ignore stop */
2020
+1-1
packages/browser/src/client/tester/tester.ts
···145145 const runner = await initiateRunner(state, mocker, config)
146146 getBrowserState().runner = runner
147147148148- // webdiverio context depends on the iframe state, so we need to switch the context,
148148+ // webdriverio context depends on the iframe state, so we need to switch the context,
149149 // we delay this in case the user doesn't use any userEvent commands to avoid the overhead
150150 if (server.provider === 'webdriverio') {
151151 let switchPromise: Promise<void> | null = null
···133133 'AbortController',
134134 'AbortSignal',
135135 'URLSearchParams',
136136- // URL and Request is overriden with a compat one
136136+ // URL and Request is overridden with a compat one
137137 // 'URL',
138138 // 'Request',
139139 ] as const
+2-2
packages/vitest/src/integrations/env/utils.ts
···52525353 const originals = new Map<string | symbol, any>()
54545555- const overridenKeys = new Set([...KEYS, ...options.additionalKeys || []])
5555+ const overriddenKeys = new Set([...KEYS, ...options.additionalKeys || []])
56565757 const overrideObject = new Map<string | symbol, any>()
5858 for (const key of keys) {
···6262 && !isClassLikeName(key)
6363 && win[key].bind(win)
64646565- if (overridenKeys.has(key) && key in global) {
6565+ if (overriddenKeys.has(key) && key in global) {
6666 originals.set(key, global[key])
6767 }
6868
+1-1
packages/vitest/src/node/browser/sessions.ts
···1616 }
17171818 createSession(sessionId: string, project: TestProject, pool: { reject: (error: Error) => void }): Promise<void> {
1919- // this promise only waits for the WS connection with the orhcestrator to be established
1919+ // this promise only waits for the WS connection with the orchestrator to be established
2020 const defer = createDefer<void>()
21212222 const timeout = setTimeout(() => {
+1-1
packages/vitest/src/node/cache/fsModuleCache.ts
···212212 consumer: config.consumer,
213213 resolve: config.resolve,
214214 // plugins can have different options, so this is not the best key,
215215- // but we canot access the options because there is no standard API for it
215215+ // but we cannot access the options because there is no standard API for it
216216 plugins: config.plugins
217217 .filter(p => p.api?.vitest?.experimental?.ignoreFsModuleCache !== true)
218218 .map(p => p.name),
+1-1
packages/vitest/src/node/config/resolveConfig.ts
···494494 resolvePath(file, resolved.root),
495495 )
496496497497- // Add hard-coded default coverage exclusions. These cannot be overidden by user config.
497497+ // Add hard-coded default coverage exclusions. These cannot be overridden by user config.
498498 // Override original exclude array for cases where user re-uses same object in test.exclude.
499499 resolved.coverage.exclude = [
500500 ...resolved.coverage.exclude,
···1212 this.ctx = ctx
1313 }
14141515- // async so it can be extended by other sequelizers
1515+ // async so it can be extended by other sequencers
1616 public async shard(files: TestSpecification[]): Promise<TestSpecification[]> {
1717 const { config } = this.ctx
1818 const { index, count } = config.shard!
···3131 .map(({ spec }) => spec)
3232 }
33333434- // async so it can be extended by other sequelizers
3434+ // async so it can be extended by other sequencers
3535 public async sort(files: TestSpecification[]): Promise<TestSpecification[]> {
3636 const cache = this.ctx.cache
3737 return [...files].sort((a, b) => {
···8686 private convertIdToImportUrl(id: string) {
8787 // TODO: vitest returns paths for external modules, but Vite returns file://
8888 // REMOVE WHEN VITE 6 SUPPORT IS OVER
8989- // unfortunetly, there is a bug in Vite where ID is resolved incorrectly, so we can't return files until the fix is merged
8989+ // unfortunately, there is a bug in Vite where ID is resolved incorrectly, so we can't return files until the fix is merged
9090 // https://github.com/vitejs/vite/pull/20449
9191 if (!isWindows || isBuiltin(id) || /^(?:node:|data:|http:|https:|file:)/.test(id)) {
9292 return id
···102102 * Vite checks that the module has exports emulating the Node.js behaviour,
103103 * but Vitest is more relaxed.
104104 *
105105- * We should keep the Vite behavour when there is a `strict` flag.
105105+ * We should keep the Vite behavior when there is a `strict` flag.
106106 * @internal
107107 */
108108 processImport(exports: Record<string, any>): Record<string, any> {