| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -771,7 +771,7 @@ export interface TestingLibraryMatchers<R extends void | Promise<void>, T = unkn | |||
| 771 | 771 | * @see https://vitest.dev/guide/browser/aria-snapshots | |
| 772 | 772 | * @see https://vitest.dev/api/expect#tomatchariasnapshot | |
| 773 | 773 | */ | |
| 774 | - toMatchAriaSnapshot: () => void | ||
| 774 | + toMatchAriaSnapshot: () => R | ||
| 775 | 775 | /** | |
| 776 | 776 | * @experimental | |
| 777 | 777 | * @description | |
@@ -802,5 +802,5 @@ export interface TestingLibraryMatchers<R extends void | Promise<void>, T = unkn | |||
| 802 | 802 | * @see https://vitest.dev/guide/browser/aria-snapshots | |
| 803 | 803 | * @see https://vitest.dev/api/expect#tomatchariaInlinesnapshot | |
| 804 | 804 | */ | |
| 805 | - toMatchAriaInlineSnapshot: (inlineSnapshot?: string) => void | ||
| 805 | + toMatchAriaInlineSnapshot: (inlineSnapshot?: string) => R | ||
| 806 | 806 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + import { expect, expectTypeOf, test } from 'vitest' | ||
| 2 | + import { page } from 'vitest/browser' | ||
| 3 | + | ||
| 4 | + test('aria snapshot matchers return the assertion result', () => { | ||
| 5 | + expectTypeOf(expect(document.body).toMatchAriaSnapshot()).toEqualTypeOf<void>() | ||
| 6 | + expectTypeOf(expect(document.body).toMatchAriaInlineSnapshot('- heading')).toEqualTypeOf<void>() | ||
| 7 | + | ||
| 8 | + expectTypeOf(expect.element(page.getByRole('main')).toMatchAriaSnapshot()).toEqualTypeOf<Promise<void>>() | ||
| 9 | + expectTypeOf(expect.element(page.getByRole('main')).toMatchAriaInlineSnapshot('- heading')).toEqualTypeOf<Promise<void>>() | ||
| 10 | + | ||
| 11 | + expectTypeOf(expect.poll(() => document.body).toMatchAriaSnapshot()).toEqualTypeOf<Promise<void>>() | ||
| 12 | + expectTypeOf(expect.poll(() => document.body).toMatchAriaInlineSnapshot('- heading')).toEqualTypeOf<Promise<void>>() | ||
| 13 | + }) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments