chaance/vitest-axe

toHaveViolations appears not to be exported

Opened this issue ยท 4 comments

When following the setup guide, I've attempted to add the following line to a unit test file as a proof-of-concept test:

import { axe, toHaveNoViolations } from 'vitest-axe';

But my IDE complains that toHaveNoViolations is not exported by vitest-axe:

Screenshot 2024-05-08 at 08 55 51

igas commented

Readme is based on prerelease version, but even in v1.0.0-pre.3 it's import { toHaveNoViolations } from "vitest-axe/matchers".

@igas But the problem is that vitest-axe/matchers only exports toHaveNoViolations as a type.

Screenshot 2024-05-19 at 23 13 57

igas commented

As I mentioned, if you want to use it, you need to install it pre-release.

fixed by using the prelease version: npm install --save-dev vitest-axe@v1.0.0-pre.3