From 658c5b32434bdff1eb68247b26ea2ca7951fe2a8 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 8 Jan 2025 07:21:45 -0600 Subject: [PATCH] chore: fix various typos (#7054) --- advanced/guide/tests.md | 2 +- api/assert.md | 4 ++-- api/expect.md | 2 +- api/index.md | 2 +- api/vi.md | 2 +- guide/browser/commands.md | 2 +- guide/browser/interactivity-api.md | 2 +- guide/browser/locators.md | 16 ++++++++-------- guide/mocking.md | 2 +- guide/reporters.md | 2 +- guide/test-context.md | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/advanced/guide/tests.md b/advanced/guide/tests.md index a59dfd1b..1e9ee1ac 100644 --- a/advanced/guide/tests.md +++ b/advanced/guide/tests.md @@ -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` diff --git a/api/assert.md b/api/assert.md index e1993a4c..707a7504 100644 --- a/api/assert.md +++ b/api/assert.md @@ -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') @@ -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') diff --git a/api/expect.md b/api/expect.md index cb87254b..ae4d77d5 100644 --- a/api/expect.md +++ b/api/expect.md @@ -1236,7 +1236,7 @@ test('spy function resolves bananas on a last call', async () => { - **Type**: `(time: number, returnValue: any) => Awaitable` -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. diff --git a/api/index.md b/api/index.md index 30dffaab..a269d94c 100644 --- a/api/index.md +++ b/api/index.md @@ -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. diff --git a/api/vi.md b/api/vi.md index 35603155..b164721d 100644 --- a/api/vi.md +++ b/api/vi.md @@ -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 diff --git a/guide/browser/commands.md b/guide/browser/commands.md index d00232ca..2350a3bd 100644 --- a/guide/browser/commands.md +++ b/guide/browser/commands.md @@ -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). diff --git a/guide/browser/interactivity-api.md b/guide/browser/interactivity-api.md index c0fefe92..d76325af 100644 --- a/guide/browser/interactivity-api.md +++ b/guide/browser/interactivity-api.md @@ -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: diff --git a/guide/browser/locators.md b/guide/browser/locators.md index b3775b1f..d9b33c35 100644 --- a/guide/browser/locators.md +++ b/guide/browser/locators.md @@ -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 @@ -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 @@ -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: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: diff --git a/guide/mocking.md b/guide/mocking.md index b3a48fb3..6793d76d 100644 --- a/guide/mocking.md +++ b/guide/mocking.md @@ -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 diff --git a/guide/reporters.md b/guide/reporters.md index cced55e9..6aa83eed 100644 --- a/guide/reporters.md +++ b/guide/reporters.md @@ -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 diff --git a/guide/test-context.md b/guide/test-context.md index 8b9a8c3b..d0a8b000 100644 --- a/guide/test-context.md +++ b/guide/test-context.md @@ -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 }, ], })