Skip to content

Commit

Permalink
chore: fix various typos (#7054)
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 authored Jan 8, 2025
1 parent 9424d22 commit 658c5b3
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion advanced/guide/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Breaking changes might not follow SemVer, please pin Vitest's version when using

Vitest exposes two methods to initiate Vitest:

- `startVitest` initiates Vitest, validates the packages are installed and runs tests immidiatly
- `startVitest` initiates Vitest, validates the packages are installed and runs tests immediately
- `createVitest` only initiates Vitest and doesn't run any tests

## `startVitest`
Expand Down
4 changes: 2 additions & 2 deletions api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Asserts that `value` is not null.
```ts
import { assert, test } from 'vitest'

const error = { message: 'error was occured' }
const error = { message: 'error was occurred' }

test('assert.isNotNull', () => {
assert.isNotNull(error, 'error is not null but object')
Expand All @@ -298,7 +298,7 @@ Asserts that `value` is NaN.
```ts
import { assert, test } from 'vitest'

const calculation = 1 * 'viitest'
const calculation = 1 * 'vitest'

test('assert.isNaN', () => {
assert.isNaN(calculation, '1 * "vitest" is NaN')
Expand Down
2 changes: 1 addition & 1 deletion api/expect.md
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ test('spy function resolves bananas on a last call', async () => {

- **Type**: `(time: number, returnValue: any) => Awaitable<void>`

You can call this assertion to check if a function has successfully resolved a certain value on a specific invokation. Requires a spy function to be passed to `expect`.
You can call this assertion to check if a function has successfully resolved a certain value on a specific invocation. Requires a spy function to be passed to `expect`.

If the function returned a promise, but it was not resolved yet, this will fail.

Expand Down
2 changes: 1 addition & 1 deletion api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ Here the `afterAll` ensures that `stopMocking` method is called after all tests

## Test Hooks

Vitest provides a few hooks that you can call _during_ the test execution to cleanup the state when the test has finished runnning.
Vitest provides a few hooks that you can call _during_ the test execution to cleanup the state when the test has finished running.

::: warning
These hooks will throw an error if they are called outside of the test body.
Expand Down
2 changes: 1 addition & 1 deletion api/vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ IntersectionObserver === undefined

## Fake Timers

This sections descibes how to work with [fake timers](/guide/mocking#timers).
This sections describes how to work with [fake timers](/guide/mocking#timers).

### vi.advanceTimersByTime

Expand Down
2 changes: 1 addition & 1 deletion guide/browser/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Custom functions will override built-in ones if they have the same name.
Vitest exposes several `playwright` specific properties on the command context.

- `page` references the full page that contains the test iframe. This is the orchestrator HTML and you most likely shouldn't touch it to not break things.
- `frame` is an async method that will resolve tester [`Frame`](https://playwright.dev/docs/api/class-frame). It has a simillar API to the `page`, but it doesn't support certain methods. If you need to query an element, you should prefer using `context.iframe` instead because it is more stable and faster.
- `frame` is an async method that will resolve tester [`Frame`](https://playwright.dev/docs/api/class-frame). It has a similar API to the `page`, but it doesn't support certain methods. If you need to query an element, you should prefer using `context.iframe` instead because it is more stable and faster.
- `iframe` is a [`FrameLocator`](https://playwright.dev/docs/api/class-framelocator) that should be used to query other elements on the page.
- `context` refers to the unique [BrowserContext](https://playwright.dev/docs/api/class-browsercontext).

Expand Down
2 changes: 1 addition & 1 deletion guide/browser/interactivity-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ test('update input', async () => {
```
::: info
Vitest doesn't expose `.type` method on the locator like `input.type` because it exists only for compatiblity with the `userEvent` library. Consider using `.fill` instead as it is faster.
Vitest doesn't expose `.type` method on the locator like `input.type` because it exists only for compatibility with the `userEvent` library. Consider using `.fill` instead as it is faster.
:::
References:
Expand Down
16 changes: 8 additions & 8 deletions guide/browser/locators.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Providing roles via `role` or `aria-*` attributes to built-in elements that alre

- `exact: boolean`

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

```tsx
<button>Hello World</button>
Expand Down Expand Up @@ -213,7 +213,7 @@ page.getByAltText('non existing alt text') // ❌

- `exact: boolean`

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

#### See also

Expand All @@ -228,7 +228,7 @@ function getByLabelText(
): Locator
```

Creates a locator capable of finding an element that has an assosiated label.
Creates a locator capable of finding an element that has an associated label.

The `page.getByLabelText('Username')` locator will find every input in the example bellow:

Expand Down Expand Up @@ -260,7 +260,7 @@ The `page.getByLabelText('Username')` locator will find every input in the examp

- `exact: boolean`

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

#### See also

Expand Down Expand Up @@ -292,7 +292,7 @@ It is generally better to rely on a label using [`getByLabelText`](#getbylabelte

- `exact: boolean`

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

#### See also

Expand Down Expand Up @@ -324,7 +324,7 @@ This locator is useful for locating non-interactive elements. If you need to loc

- `exact: boolean`

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

#### See also

Expand Down Expand Up @@ -352,7 +352,7 @@ page.getByTitle('Create') // ❌

- `exact: boolean`

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

#### See also

Expand Down Expand Up @@ -659,7 +659,7 @@ function query(): Element | null

This method returns a single element matching the locator's selector or `null` if no element is found.

If multilple elements match the selector, this method will throw an error. Use [`.elements()`](#elements) when you need all matching DOM Elements or [`.all()`](#all) if you need an array of locators matching the selector.
If multiple elements match the selector, this method will throw an error. Use [`.elements()`](#elements) when you need all matching DOM Elements or [`.all()`](#all) if you need an array of locators matching the selector.

Consider the following DOM structure:

Expand Down
2 changes: 1 addition & 1 deletion guide/mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When writing tests it's only a matter of time before you need to create a "fake"
Always remember to clear or restore mocks before or after each test run to undo mock state changes between runs! See [`mockReset`](/api/mock#mockreset) docs for more info.
:::

If you are not familliar with `vi.fn`, `vi.mock` or `vi.spyOn` methods, check the [API section](/api/vi) first.
If you are not familiar with `vi.fn`, `vi.mock` or `vi.spyOn` methods, check the [API section](/api/vi) first.

## Dates

Expand Down
2 changes: 1 addition & 1 deletion guide/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ export default defineConfig({
### Blob Reporter

Stores test results on the machine so they can be later merged using [`--merge-reports`](/guide/cli#merge-reports) command.
By default, stores all results in `.vitest-reports` folder, but can be overriden with `--outputFile` or `--outputFile.blob` flags.
By default, stores all results in `.vitest-reports` folder, but can be overridden with `--outputFile` or `--outputFile.blob` flags.

```bash
npx vitest --reporter=blob --outputFile=reports/blob-1.json
Expand Down
2 changes: 1 addition & 1 deletion guide/test-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const test = base.extend({
url: [
// default value if "url" is not defined in the config
'default',
// mark the fixure as "injected" to allow the override
// mark the fixture as "injected" to allow the override
{ injected: true },
],
})
Expand Down

0 comments on commit 658c5b3

Please sign in to comment.