diff --git a/docs/config/index.md b/docs/config/index.md index 673125da3..46d0c10a2 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -619,7 +619,7 @@ In CI, or when run from a non-interactive shell, "watch" mode is not the default Vitest reruns tests based on the module graph which is populated by static and dynamic `import` statements. However, if you are reading from the file system or fetching from a proxy, then Vitest cannot detect those dependencies. -To correctly rerun those tests, you can define a regex pattern and a function that retuns a list of test files to run. +To correctly rerun those tests, you can define a regex pattern and a function that returns a list of test files to run. ```ts import { defineConfig } from 'vitest/config' diff --git a/docs/guide/browser/assertion-api.md b/docs/guide/browser/assertion-api.md index 5d8881f9a..b10901a5b 100644 --- a/docs/guide/browser/assertion-api.md +++ b/docs/guide/browser/assertion-api.md @@ -1018,7 +1018,7 @@ other element that contains text, such as a paragraph, span, div etc. ::: warning The expected selection is a string, it does not allow to check for -selection range indeces. +selection range indices. ::: ```html diff --git a/docs/guide/browser/commands.md b/docs/guide/browser/commands.md index 9b6e33bb7..2c7df3bd4 100644 --- a/docs/guide/browser/commands.md +++ b/docs/guide/browser/commands.md @@ -11,7 +11,7 @@ Command is a function that invokes another function on the server and passes dow ### Files Handling -You can use the `readFile`, `writeFile`, and `removeFile` APIs to handle files in your browser tests. Since Vitest 3.2, all paths are resolved relative to the [project](/guide/projects) root (which is `process.cwd()`, unless overriden manually). Previously, paths were resolved relative to the test file. +You can use the `readFile`, `writeFile`, and `removeFile` APIs to handle files in your browser tests. Since Vitest 3.2, all paths are resolved relative to the [project](/guide/projects) root (which is `process.cwd()`, unless overridden manually). Previously, paths were resolved relative to the test file. By default, Vitest uses `utf-8` encoding but you can override it with options. diff --git a/docs/guide/browser/locators.md b/docs/guide/browser/locators.md index ae108c716..42e735ae8 100644 --- a/docs/guide/browser/locators.md +++ b/docs/guide/browser/locators.md @@ -234,7 +234,7 @@ function getByLabelText( 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: +The `page.getByLabelText('Username')` locator will find every input in the example below: ```html // for/htmlFor relationship between label and form element id @@ -1004,7 +1004,7 @@ declare module '@vitest/browser/context' { } ``` -If the method is called on the global `page` object, then selector will be applied to the whole page. In the example bellow, `getByArticleTitle` will find all elements with an attribute `data-title` with the value of `title`. However, if the method is called on the locator, then it will be scoped to that locator. +If the method is called on the global `page` object, then selector will be applied to the whole page. In the example below, `getByArticleTitle` will find all elements with an attribute `data-title` with the value of `title`. However, if the method is called on the locator, then it will be scoped to that locator. ```html
diff --git a/docs/guide/test-context.md b/docs/guide/test-context.md index fe598dec8..e0ff4b70e 100644 --- a/docs/guide/test-context.md +++ b/docs/guide/test-context.md @@ -325,7 +325,7 @@ describe('use scoped values', () => { test.scoped({ dependency: 'new' }) test('uses scoped value', ({ dependant }) => { - // `dependant` uses the new overriden value that is scoped + // `dependant` uses the new overridden value that is scoped // to all tests in this suite expect(dependant).toEqual({ dependency: 'new' }) }) diff --git a/packages/browser/jest-dom.d.ts b/packages/browser/jest-dom.d.ts index d0769b8ec..7064c2e34 100644 --- a/packages/browser/jest-dom.d.ts +++ b/packages/browser/jest-dom.d.ts @@ -627,7 +627,7 @@ export interface TestingLibraryMatchers { * other element that contains text, such as a paragraph, span, div etc. * * NOTE: the expected selection is a string, it does not allow to check for - * selection range indeces. + * selection range indices. * * @example *
diff --git a/packages/browser/src/client/orchestrator.ts b/packages/browser/src/client/orchestrator.ts index 448638374..54bf0b69d 100644 --- a/packages/browser/src/client/orchestrator.ts +++ b/packages/browser/src/client/orchestrator.ts @@ -70,7 +70,7 @@ export class IframeOrchestrator { public async cleanupTesters(): Promise { const config = getConfig() if (config.browser.isolate) { - // isolated mode assignes filepaths as ids + // isolated mode assigns filepaths as ids const files = Array.from(this.iframes.keys()) // when the run is completed, show the last file in the UI const ui = getUiAPI() diff --git a/packages/browser/src/client/tester/tester.ts b/packages/browser/src/client/tester/tester.ts index 105857fdb..cacce1b6b 100644 --- a/packages/browser/src/client/tester/tester.ts +++ b/packages/browser/src/client/tester/tester.ts @@ -32,7 +32,7 @@ channel.addEventListener('message', async (e) => { if (!isEvent(data)) { const error = new Error(`Unknown message: ${JSON.stringify(e.data)}`) - unhandledError(error, 'Uknown Iframe Message') + unhandledError(error, 'Unknown Iframe Message') return } @@ -73,7 +73,7 @@ channel.addEventListener('message', async (e) => { } default: { const error = new Error(`Unknown event: ${(data as any).event}`) - unhandledError(error, 'Uknown Event') + unhandledError(error, 'Unknown Event') } } diff --git a/packages/browser/src/node/pool.ts b/packages/browser/src/node/pool.ts index 575df34de..d843d8dfa 100644 --- a/packages/browser/src/node/pool.ts +++ b/packages/browser/src/node/pool.ts @@ -332,7 +332,7 @@ class BrowserPool { this.runNextTest(method, sessionId) }) .catch((error) => { - // if user cancells the test run manually, ignore the error and exit gracefully + // if user cancels the test run manually, ignore the error and exit gracefully if ( this.project.vitest.isCancelling && error instanceof Error diff --git a/packages/browser/src/node/serverOrchestrator.ts b/packages/browser/src/node/serverOrchestrator.ts index 6dc899e59..da2668ec5 100644 --- a/packages/browser/src/node/serverOrchestrator.ts +++ b/packages/browser/src/node/serverOrchestrator.ts @@ -26,7 +26,7 @@ export async function resolveOrchestrator( return } - // ignore uknown pages + // ignore unknown pages if (sessionId && sessionId !== 'none' && !globalServer.vitest._browserSessions.sessionIds.has(sessionId)) { return } diff --git a/packages/browser/utils.d.ts b/packages/browser/utils.d.ts index cd62022af..72d08cce6 100644 --- a/packages/browser/utils.d.ts +++ b/packages/browser/utils.d.ts @@ -1,5 +1,5 @@ // should be in sync with tester/public-utils.ts -// we cannot bundle it because vitest depend on the @vitest/browser and vise versa +// we cannot bundle it because vitest depend on the @vitest/browser and vice versa // fortunately, the file is quite small import { LocatorSelectors, Locator } from '@vitest/browser/context' diff --git a/packages/runner/src/types/tasks.ts b/packages/runner/src/types/tasks.ts index 5066e6825..fa2ae30c5 100644 --- a/packages/runner/src/types/tasks.ts +++ b/packages/runner/src/types/tasks.ts @@ -197,7 +197,7 @@ export type TaskEventPack = [ */ event: TaskUpdateEvent, /** - * Data assosiated with the event + * Data associated with the event */ data: TaskEventData | undefined, ] diff --git a/packages/ui/client/composables/navigation.ts b/packages/ui/client/composables/navigation.ts index b8c085976..3a81038da 100644 --- a/packages/ui/client/composables/navigation.ts +++ b/packages/ui/client/composables/navigation.ts @@ -136,7 +136,7 @@ export function hideRightPanel() { function calculateBrowserPanel() { // we don't scale webdriverio provider because it doesn't support scaling - // TODO: find a way to make this universal - maybe show browser separetly(?) + // TODO: find a way to make this universal - maybe show browser separately(?) if (browserState?.provider === 'webdriverio') { const parentWindow = window.outerWidth * (panels.details.size / 100) // 40 is 20px padding for each sice diff --git a/packages/vitest/src/node/types/config.ts b/packages/vitest/src/node/types/config.ts index 536f1fa24..cdcc79546 100644 --- a/packages/vitest/src/node/types/config.ts +++ b/packages/vitest/src/node/types/config.ts @@ -468,7 +468,7 @@ export interface InlineConfig { globalSetup?: string | string[] /** - * Glob patter of file paths that will trigger the whole suite rerun + * Glob pattern of file paths that will trigger the whole suite rerun * * Useful if you are testing calling CLI commands * diff --git a/packages/vitest/src/runtime/runners/index.ts b/packages/vitest/src/runtime/runners/index.ts index 26d91a2a2..b955fd026 100644 --- a/packages/vitest/src/runtime/runners/index.ts +++ b/packages/vitest/src/runtime/runners/index.ts @@ -72,9 +72,9 @@ export async function resolveTestRunner( const originalOnTestAnnotate = testRunner.onTestAnnotate testRunner.onTestAnnotate = async (test, annotation) => { const p = rpc().onTaskAnnotate(test.id, annotation) - const overridenResult = await originalOnTestAnnotate?.call(testRunner, test, annotation) + const overriddenResult = await originalOnTestAnnotate?.call(testRunner, test, annotation) const vitestResult = await p - return overridenResult || vitestResult + return overriddenResult || vitestResult } const originalOnCollectStart = testRunner.onCollectStart diff --git a/test/browser/fixtures/expect-dom/toContainHTML.test.ts b/test/browser/fixtures/expect-dom/toContainHTML.test.ts index a24d575ce..f1a4c5154 100644 --- a/test/browser/fixtures/expect-dom/toContainHTML.test.ts +++ b/test/browser/fixtures/expect-dom/toContainHTML.test.ts @@ -98,7 +98,7 @@ describe('.toContainHTML', () => { test('throws with an expected text', async () => { const {queryByTestId} = render('') const htmlElement = queryByTestId('child') - const nonExistantString = '
non-existant element
' + const nonExistantString = '
non-existent element
' let errorMessage try { @@ -110,7 +110,7 @@ describe('.toContainHTML', () => { expect(errorMessage).toMatchInlineSnapshot(` expect(element).toContainHTML() Expected: -
non-existant element
+
non-existent element
Received: { ]) }) -test('assignes names as browsers in a custom project', async () => { +test('assigns names as browsers in a custom project', async () => { const { projects } = await vitest({}, { projects: [ { @@ -127,8 +127,8 @@ test('inherits browser options', async () => { width: 900, height: 300, }, - testerHtmlPath: '/custom-overriden-path.html', - screenshotDirectory: '/custom-overriden-directory', + testerHtmlPath: '/custom-overridden-path.html', + screenshotDirectory: '/custom-overridden-directory', }, ], }, @@ -170,11 +170,11 @@ test('inherits browser options', async () => { width: 900, height: 300, }, - screenshotDirectory: '/custom-overriden-directory', + screenshotDirectory: '/custom-overridden-directory', locators: { testIdAttribute: 'data-custom', }, - testerHtmlPath: '/custom-overriden-path.html', + testerHtmlPath: '/custom-overridden-path.html', }, }, ]) @@ -463,7 +463,7 @@ describe('[e2e] workspace configs are affected by the CLI options', () => { expect(config.workspace[1]).toEqual({ name: 'browser (chromium)', - // headless was overriden by CLI options + // headless was overridden by CLI options headless: false, browser: true, // UI should be true because we always set CI to false, diff --git a/test/config/test/configureVitest.test.ts b/test/config/test/configureVitest.test.ts index e470b3571..5ddcfbf16 100644 --- a/test/config/test/configureVitest.test.ts +++ b/test/config/test/configureVitest.test.ts @@ -139,7 +139,7 @@ test('injected plugin is filtered by the --project filter', async () => { expect(newWorkspace).toHaveLength(0) }) -test('injected plugin is not filtered by the --project filter when it\'s overriden', async () => { +test('injected plugin is not filtered by the --project filter when it\'s overridden', async () => { let newWorkspace: TestProject[] = [] const { projects } = await vitest({ project: 'project-1', diff --git a/test/core/test/test-extend.test.ts b/test/core/test/test-extend.test.ts index 8c04d970c..632d34201 100644 --- a/test/core/test/test-extend.test.ts +++ b/test/core/test/test-extend.test.ts @@ -411,7 +411,7 @@ describe('scoping variables to suite', () => { }) }) - describe('override nested overriden scope', () => { + describe('override nested overridden scope', () => { testAPI.scoped({ dependency: 'override' }) testAPI('keeps using new values', ({ pkg }) => { diff --git a/test/ui/fixtures/console.test.ts b/test/ui/fixtures/console.test.ts index 8318c03bd..9dad199a7 100644 --- a/test/ui/fixtures/console.test.ts +++ b/test/ui/fixtures/console.test.ts @@ -28,7 +28,7 @@ it('html-pretty', () => { - `.replaceAll(/\n */gm, ""); // strip new liens + `.replaceAll(/\n */gm, ""); // strip new lines console.log(prettyDOM(div)) })