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

TypeError: rel attribute has no supported tokens #9631

Closed
TheDutchCoder opened this issue Mar 3, 2020 · 2 comments
Closed

TypeError: rel attribute has no supported tokens #9631

TheDutchCoder opened this issue Mar 3, 2020 · 2 comments

Comments

@TheDutchCoder
Copy link

🐛 Bug Report

I'm running a test to detect AR capabilities in the browser. I do this by checking an anchor's relList for 'ar' support with anchor.relList.supports('ar').

However, Jest then fails with TypeError: rel attribute has no supported tokens, instead of simply returning false.

To Reproduce

Steps to reproduce the behavior:

const anchor = document.createElement('a')

return anchor &&
    'relList' in anchor &&
    'supports' in anchor.relList &&
    typeof anchor.relList.supports === 'function' &&
    anchor.relList.supports('ar')

Expected behavior

Simply to return false.

envinfo

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 10.14.2 - ~/.nvm/versions/node/v10.14.2/bin/node
    Yarn: 1.9.4 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.14.2/bin/npm
  npmPackages:
    jest: ^24.9.0 => 24.9.0 
@SimenB
Copy link
Member

SimenB commented Feb 10, 2022

This issue belongs in JSDOM, Jest itself doesn't implement any browser APIs.

EDIT: RIght, you've already filed jsdom/jsdom#2895 🙂 That's the place

@SimenB SimenB closed this as completed Feb 10, 2022
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants