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

unknown pseudo-class selector ':defined' #77

Closed
CITguy opened this issue Mar 14, 2023 · 1 comment
Closed

unknown pseudo-class selector ':defined' #77

CITguy opened this issue Mar 14, 2023 · 1 comment

Comments

@CITguy
Copy link

CITguy commented Mar 14, 2023

Basic Info:

  • Node.js version: 18.14.0
  • nwsapi version: 2.2.2
    • installed as a dependency of jsdom 20.0.3
      • installed asinstalled as a dependency of jest-environment-jsdom 29.5.0

Additional Info

Per MDN and WHATWG, the :defined pseudo-selector should be a valid selector.

I want to use this selector within jest unit tests to check that a custom element has been defined.

@dperini
Copy link
Owner

dperini commented Apr 7, 2023

@CITguy
I will consider this pseudo-class addition in a future release. In the meantime you can load a duplicate instance of "nwsapi"
and extend it to cover your needs by using something like the following:

NW.Dom.registerSelector(
  'elementDefined',
   /^\:defined/i,
  (function(global) {
    ...
    // see details in src/module/nwsapi-jquery.js
    ...
  })(this));

@dperini dperini closed this as completed Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants