Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Not implemented: window.computedStyle(elt, pseudoElt) #2061

Closed
6 tasks done
fikryfahrezy opened this issue Sep 20, 2022 · 2 comments
Closed
6 tasks done

Error: Not implemented: window.computedStyle(elt, pseudoElt) #2061

fikryfahrezy opened this issue Sep 20, 2022 · 2 comments

Comments

@fikryfahrezy
Copy link

Describe the bug

Vitest show Error: Not implemented: window.computedStyle(elt, pseudoElt) while Jest not.

I'm about to migrate my react app with Ant Design from Jest to Vitest, after I'm done following migration guide and try run the new test with Vitest, Vitest show the error message come from JSDOM.

The error message only show if I test the the specific Ant Design component (Table in this case).

Reproduction

https://github.com/fikryfahrezy/my-react-app

Run test with Jest

yarn test:jest src/index.jest.test.tsx

Run test with Vitest

yarn test:vitest src/index.vitest.test.tsx

System Info

System:
    OS: Linux 5.19 undefined
    CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
    Memory: 6.58 GB / 19.39 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 14.20.0 - /run/user/1000/fnm_multishells/390656_1663662564383/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 6.14.17 - /run/user/1000/fnm_multishells/390656_1663662564383/bin/npm
  Browsers:
    Brave Browser: 105.1.43.89
    Firefox: 103.0.2
  npmPackages:
    @vitejs/plugin-react: ^2.1.0 => 2.1.0 
    vite: ^3.1.0 => 3.1.3 
    vitest: ^0.23.4 => 0.23.4

Used Package Manager

yarn

Validations

@sheremet-va
Copy link
Member

I don't know what Jest does under the hood, but this is normal JSDOM behaviour as far as I understand. Try workaround from this thread: NickColley/jest-axe#147

@fikryfahrezy
Copy link
Author

The error not showing after try the workaround from NickColley/jest-axe/#147.

Thanks @sheremet-va for your help.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants