Skip to content

Commit 3fdee3d

Browse files
authored
chore: fix various typos (#7663)
1 parent 29f5a84 commit 3fdee3d

File tree

20 files changed

+30
-30
lines changed

20 files changed

+30
-30
lines changed

docs/advanced/api/reporters.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function onInit(vitest: Vitest): Awaitable<void>
5252
This method is called when [Vitest](/advanced/api/vitest) was initiated or started, but before the tests were filtered.
5353

5454
::: info
55-
Internally this method is called inside [`vitest.start`](/advanced/api/vitest#start), [`vitest.init`](/advanced/api/vitest#init) or [`vitest.mergeReports`](/advanced/api/vitest#mergereports). If you are using programmatic API, make sure to call either one dependning on your needs before calling [`vitest.runTestSpecifications`](/advanced/api/vitest#runtestspecifications), for example. Built-in CLI will always run methods in correct order.
55+
Internally this method is called inside [`vitest.start`](/advanced/api/vitest#start), [`vitest.init`](/advanced/api/vitest#init) or [`vitest.mergeReports`](/advanced/api/vitest#mergereports). If you are using programmatic API, make sure to call either one depending on your needs before calling [`vitest.runTestSpecifications`](/advanced/api/vitest#runtestspecifications), for example. Built-in CLI will always run methods in correct order.
5656
:::
5757

5858
Note that you can also get access to `vitest` instance from test cases, suites and test modules via a [`project`](/advanced/api/test-project) property, but it might also be useful to store a reference to `vitest` in this method.
@@ -139,7 +139,7 @@ The third argument indicated why the test run was finished:
139139

140140
- `passed`: test run was finished normally and there are no errors
141141
- `failed`: test run has at least one error (due to a syntax error during collection or an actual error during test execution)
142-
- `interrupted`: test was interruped by [`vitest.cancelCurrentRun`](/advanced/api/vitest#cancelcurrentrun) call or `Ctrl+C` was pressed in the terminal (note that it's still possible to have failed tests in this case)
142+
- `interrupted`: test was interrupted by [`vitest.cancelCurrentRun`](/advanced/api/vitest#cancelcurrentrun) call or `Ctrl+C` was pressed in the terminal (note that it's still possible to have failed tests in this case)
143143

144144
If Vitest didn't find any test files to run, this event will be invoked with empty arrays of modules and errors, and the state will depend on the value of [`config.passWithNoTests`](/config/#passwithnotests).
145145

docs/advanced/api/test-project.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const value = inject('key')
124124
```
125125
:::
126126

127-
The values can be provided dynamicaly. Provided value in tests will be updated on their next run.
127+
The values can be provided dynamically. Provided value in tests will be updated on their next run.
128128

129129
::: tip
130130
This method is also available to [global setup files](/config/#globalsetup) for cases where you cannot use the public API:

docs/advanced/api/test-specification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The ID of the module in Vite's module graph. Usually, it's an absolute file path
3333

3434
## testModule
3535

36-
Instance of [`TestModule`](/advanced/api/test-module) assosiated with the specification. If test wasn't queued yet, this will be `undefined`.
36+
Instance of [`TestModule`](/advanced/api/test-module) associated with the specification. If test wasn't queued yet, this will be `undefined`.
3737

3838
## pool <Badge type="warning">experimental</Badge> {#pool}
3939

docs/advanced/api/vitest.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ In the future, the old API won't be exposed anymore.
9393

9494
The global snapshot manager. Vitest keeps track of all snapshots using the `snapshot.add` method.
9595

96-
You can get the latest summary of snapshots via the `vitest.snapshot.summay` property.
96+
You can get the latest summary of snapshots via the `vitest.snapshot.summary` property.
9797

9898
## cache
9999

@@ -130,7 +130,7 @@ function provide<T extends keyof ProvidedContext & string>(
130130

131131
Vitest exposes `provide` method which is a shorthand for `vitest.getRootProject().provide`. With this method you can pass down values from the main thread to tests. All values are checked with `structuredClone` before they are stored, but the values themselves are not cloned.
132132

133-
To recieve the values in the test, you need to import `inject` method from `vitest` entrypont:
133+
To receive the values in the test, you need to import `inject` method from `vitest` entrypoint:
134134

135135
```ts
136136
import { inject } from 'vitest'
@@ -172,7 +172,7 @@ This returns the root context object. This is a shorthand for `vitest.getRootPro
172172
function getProjectByName(name: string): TestProject
173173
```
174174

175-
This method returns the project by its name. Simillar to calling `vitest.projects.find`.
175+
This method returns the project by its name. Similar to calling `vitest.projects.find`.
176176

177177
::: warning
178178
In case the project doesn't exist, this method will return the root project - make sure to check the names again if the project you are looking for is the one returned.
@@ -297,7 +297,7 @@ As of Vitest 3, this method uses a cache to check if the file is a test. To make
297297
function clearSpecificationsCache(moduleId?: string): void
298298
```
299299

300-
Vitest automatically caches test specifications for each file when [`globTestSpecifications`](#globtestspecifications) or [`runTestSpecifications`](#runtestspecifications) is called. This method clears the cache for the given file or the whole cache alltogether depending on the first argument.
300+
Vitest automatically caches test specifications for each file when [`globTestSpecifications`](#globtestspecifications) or [`runTestSpecifications`](#runtestspecifications) is called. This method clears the cache for the given file or the whole cache altogether depending on the first argument.
301301

302302
## runTestSpecifications
303303

@@ -452,7 +452,7 @@ function exit(force = false): Promise<void>
452452

453453
Closes all projects and exit the process. If `force` is set to `true`, the process will exit immediately after closing the projects.
454454

455-
This method will also forcefuly call `process.exit()` if the process is still active after [`config.teardownTimeout`](/config/#teardowntimeout) milliseconds.
455+
This method will also forcefully call `process.exit()` if the process is still active after [`config.teardownTimeout`](/config/#teardowntimeout) milliseconds.
456456

457457
## shouldKeepServer
458458

docs/advanced/guide/tests.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ finally {
7171
}
7272
```
7373

74-
If you intend to keep the `Vitest` instance, make sure to at least call [`init`](/advanced/api/vitest#init). This will initialise reporters and the coverage provider, but won't run any tests. It is also recommended to enable the `watch` mode even if you don't intend to use the Vitest watcher, but want to keep the instance running. Vitest relies on this flag for some of its features to work correctly in a continous process.
74+
If you intend to keep the `Vitest` instance, make sure to at least call [`init`](/advanced/api/vitest#init). This will initialise reporters and the coverage provider, but won't run any tests. It is also recommended to enable the `watch` mode even if you don't intend to use the Vitest watcher, but want to keep the instance running. Vitest relies on this flag for some of its features to work correctly in a continuous process.
7575

7676
After reporters are initialised, use [`runTestSpecifications`](/advanced/api/vitest#runtestspecifications) or [`rerunTestSpecifications`](/advanced/api/vitest#reruntestspecifications) to run tests if manual run is required:
7777

@@ -88,7 +88,7 @@ watcher.on('change', async (file) => {
8888
```
8989

9090
::: warning
91-
The example above shows a potential usecase if you disable the default watcher behaviour. By default, Vitest already reruns tests if files change.
91+
The example above shows a potential use-case if you disable the default watcher behaviour. By default, Vitest already reruns tests if files change.
9292

9393
Also note that `getModuleSpecifications` will not resolve test files unless they were already processed by `globTestSpecifications`. If the file was just created, use `project.matchesGlobPattern` instead:
9494

docs/guide/browser/locators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ It is recommended to use this only after the other locators don't work for your
381381

382382
- `exact: boolean`
383383

384-
Whether the `text` is matched exactly: case-sensetive and whole-string. Disabled by default. This option is ignored if `text` is a regular expression. Note that exact match still trims whitespace.
384+
Whether the `text` is matched exactly: case-sensitive and whole-string. Disabled by default. This option is ignored if `text` is a regular expression. Note that exact match still trims whitespace.
385385

386386
#### See also
387387

docs/guide/browser/multiple-setups.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Since Vitest 3, you can specify several different browser setups using the new [`browser.instances`](/guide/browser/config#browser-instances) option.
44

5-
The main advatage of using the `browser.instances` over the [workspace](/guide/workspace) is improved caching. Every project will use the same Vite server meaning the file transform and [dependency pre-bundling](https://vite.dev/guide/dep-pre-bundling.html) has to happen only once.
5+
The main advantage of using the `browser.instances` over the [workspace](/guide/workspace) is improved caching. Every project will use the same Vite server meaning the file transform and [dependency pre-bundling](https://vite.dev/guide/dep-pre-bundling.html) has to happen only once.
66

77
## Several Browsers
88

@@ -128,7 +128,7 @@ start tests with --browser=name or --project=name flag. › - Use arrow-keys. Re
128128
firefox
129129
```
130130

131-
If you have several non-headless projects in CI (i.e. the `headless: false` is set manually in the config and not overriden in CI env), Vitest will fail the run and won't start any tests.
131+
If you have several non-headless projects in CI (i.e. the `headless: false` is set manually in the config and not overridden in CI env), Vitest will fail the run and won't start any tests.
132132

133133
The ability to run tests in headless mode is not affected by this. You can still run all instances in parallel as long as they don't have `headless: false`.
134134
:::

docs/guide/browser/playwright.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Note that the context is created for every _test file_, not every _test_ like in
7474
:::
7575

7676
::: warning
77-
Vitest awlays sets `ignoreHTTPSErrors` to `true` in case your server is served via HTTPS and `serviceWorkers` to `'allow'` to support module mocking via [MSW](https://mswjs.io).
77+
Vitest always sets `ignoreHTTPSErrors` to `true` in case your server is served via HTTPS and `serviceWorkers` to `'allow'` to support module mocking via [MSW](https://mswjs.io).
7878

7979
It is also recommended to use [`test.browser.viewport`](/guide/browser/config#browser-headless) instead of specifying it here as it will be lost when tests are running in headless mode.
8080
:::

packages/expect/src/jest-expect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
578578
})
579579

580580
// manually compare array elements since `jestEquals` cannot
581-
// apply assymetric matcher to `undefined` array element.
581+
// apply asymmetric matcher to `undefined` array element.
582582
function equalsArgumentArray(a: unknown[], b: unknown[]) {
583583
return a.length === b.length && a.every((aItem, i) =>
584584
jestEquals(aItem, b[i], [...customTesters, iterableEquality]),

packages/vitest/src/api/check.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import crypto from 'node:crypto'
55
export function isValidApiRequest(config: ResolvedConfig, req: IncomingMessage): boolean {
66
const url = new URL(req.url ?? '', 'http://localhost')
77

8-
// validate token. token is injected in ui/tester/orchestrator html, which is cross origin proteced.
8+
// validate token. token is injected in ui/tester/orchestrator html, which is cross origin protected.
99
try {
1010
const token = url.searchParams.get('token')
1111
if (token && crypto.timingSafeEqual(

packages/vitest/src/integrations/mock/timers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export class FakeTimers {
2020
// | _fakingTime | _fakingDate |
2121
// +-------------+-------------+
2222
// | false | falsy | initial
23-
// | false | truethy | vi.setSystemTime called first (for mocking only Date without fake timers)
23+
// | false | truthy | vi.setSystemTime called first (for mocking only Date without fake timers)
2424
// | true | falsy | vi.useFakeTimers called first
25-
// | true | truethy | unreachable
25+
// | true | truthy | unreachable
2626
private _fakingTime: boolean
2727
private _fakingDate: Date | null
2828
private _fakeTimers: FakeTimerWithContext

packages/vitest/src/node/reporters/summary.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export class SummaryReporter implements Reporter {
248248
}
249249
else {
250250
// Run is about to end as there are less tests left than whole run had parallel at max.
251-
// Remove finished test immediatelly.
251+
// Remove finished test immediately.
252252
this.removeTestModule(module.id)
253253
}
254254

packages/vitest/src/node/specifications.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class VitestSpecifications {
5555
f => ({ ...f, filename: resolve(dir, f.filename) }),
5656
))
5757

58-
// Key is file and val sepcifies whether we have matched this file with testLocation
58+
// Key is file and val specifies whether we have matched this file with testLocation
5959
const testLocHasMatch: { [f: string]: boolean } = {}
6060

6161
await Promise.all(this.vitest.projects.map(async (project) => {

packages/vitest/src/node/workspace/resolveWorkspace.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export async function resolveBrowserWorkspace(
216216

217217
if (project.config.browser.providerOptions) {
218218
vitest.logger.warn(
219-
withLabel('yellow', 'Vitest', `"providerOptions"${originalName ? ` in "${originalName}" project` : ''} is ignored because it's overriden by the configs. To hide this warning, remove the "providerOptions" property from the browser configuration.`),
219+
withLabel('yellow', 'Vitest', `"providerOptions"${originalName ? ` in "${originalName}" project` : ''} is ignored because it's overridden by the configs. To hide this warning, remove the "providerOptions" property from the browser configuration.`),
220220
)
221221
}
222222

test/config/test/browser-configs.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function vitest(cliOptions: UserConfig, configValue: UserConfig = {}, vite
99
return vitest
1010
}
1111

12-
test('assignes names as browsers', async () => {
12+
test('assigns names as browsers', async () => {
1313
const { projects } = await vitest({
1414
browser: {
1515
enabled: true,
@@ -45,7 +45,7 @@ test('filters projects', async () => {
4545
])
4646
})
4747

48-
test('filters projects with a wildecard', async () => {
48+
test('filters projects with a wildcard', async () => {
4949
const { projects } = await vitest({
5050
project: 'chrom*',
5151
browser: {

test/config/test/failures.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ test('browser.instances is empty', async () => {
426426
expect(stderr).toMatch('"browser.instances" was set in the config, but the array is empty. Define at least one browser config.')
427427
})
428428

429-
test('browser.name filteres all browser.instances are required', async () => {
429+
test('browser.name filters all browser.instances are required', async () => {
430430
const { stderr } = await runVitest({
431431
browser: {
432432
enabled: true,

test/coverage-test/fixtures/test/isolation-1-fixture.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test } from "vitest";
22
import { multiply, remainder, subtract, sum } from "../src/math";
33

4-
test("Should run function sucessfully", async () => {
4+
test("Should run function successfully", async () => {
55
sum(1, 1);
66
subtract(1,2)
77
multiply(3,4)

test/reporters/tests/test-run.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ describe('merge reports', () => {
897897
})
898898

899899
describe('type checking', () => {
900-
test('typechking is reported correctly', async () => {
900+
test('typechecking is reported correctly', async () => {
901901
const report = await run({
902902
'example-1.test-d.ts': ts`
903903
test('first', () => {});

test/snapshots/test/inline-multiple-calls.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test('same snapshots in single test', async () => {
1313
const testFile = join(root, 'same.test.ts')
1414
editFile(testFile, s => s.replace(/toMatchInlineSnapshot\(`.*`\)/gs, 'toMatchInlineSnapshot()'))
1515

16-
// iniital run (create snapshot)
16+
// initial run (create snapshot)
1717
let vitest = await runVitest({
1818
root,
1919
include: [testFile],
@@ -102,7 +102,7 @@ test('same snapshots in multiple tests', async () => {
102102
const testFile = join(root, 'same2.test.ts')
103103
editFile(testFile, s => s.replace(/toMatchInlineSnapshot\(`.*`\)/gs, 'toMatchInlineSnapshot()'))
104104

105-
// iniital run (create snapshot)
105+
// initial run (create snapshot)
106106
let vitest = await runVitest({
107107
root,
108108
include: [testFile],

test/snapshots/test/jest-image-snapshot.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { join } from 'node:path'
33
import { expect, test } from 'vitest'
44
import { runVitest } from '../../test-utils'
55

6-
test('jest-image-sapshot', async () => {
6+
test('jest-image-snapshot', async () => {
77
// cleanup snapshot
88
const root = join(import.meta.dirname, 'fixtures/jest-image-snapshot')
99
fs.rmSync(join(root, '__image_snapshots__'), { recursive: true, force: true })

0 commit comments

Comments
 (0)