Accessibility test API

Last modified by Manuel Leduc on 2026/03/25 15:23

Reference

Variables

test

An extended version of test from Vitest that runs an axe-core validation on the tested Vue container after the end of the test.

it

Alias of test.

Functions

assertAxe

Run an axe core check on the provided vue component wrapper and check for the absence of issues.

assertAxe(wrapper: VueWrapper): Promise<void>

mountHelper

Helper to initialize a Vue Wrapper with the right configuration. In particular making sure that the component is mounted with and attached to an HTML document body. Returns a method that expect additional mount option to be merged with the default.

mountHelper(
    component: Component,
    baseConfig?: Record<string, unknown>,
): (config?: Record<string, unknown>) => VueWrapper

runTest

Execute a test and checks for the accessibility of the tested component with axe core at the end.

runTest(
    name: string,
    wrapper: VueWrapper,
    assertions: (wrapper: VueWrapper) => void | Promise<void>,
): void

shallowMountHelper

Helper to initialize a Vue Wrapper with the right configuration. In particular making sure that the component is shallow mounted with and attached to an HTML document body. Returns a method that expect additional shallow mount option to be merged with the default

shallowMountHelper(
    component: Component,
    baseConfig?: Record<string, unknown>,
): (config?: Record<string, unknown>) => VueWrapper

Related

https://vitest.dev/

Get Connected