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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

n.compareDocumentPosition is not a function #524

Closed
smarlhens opened this issue Jun 29, 2022 · 3 comments 路 Fixed by #539
Closed

n.compareDocumentPosition is not a function #524

smarlhens opened this issue Jun 29, 2022 · 3 comments 路 Fixed by #539
Labels
enhancement New feature or request

Comments

@smarlhens
Copy link
Contributor

smarlhens commented Jun 29, 2022

Hi there 馃憢馃徎 ,

I hope it is the right place to ask, and I apologize if not. I'm currently using happy-dom with vitest but I'm facing the following error:

image

Binaries:
    Node: 16.15.1 - /usr/bin/node
    npm: 8.11.0 - /usr/bin/npm
  npmPackages:
    happy-dom: 5.3.4 => 5.3.4 
    vite: 2.9.13 => 2.9.13 
    vitest: 0.16.0 => 0.16.0

Reproduction repo: smarlhens/vite-vitest-happy-dom-compare-document-position-is-not-a-function

You can check using jsdom with vitest by switching test.environment: 'jsdom' in vite.config.ts.

Thanks in advance for your help, wish you a nice day sunny

@capricorn86 capricorn86 added the enhancement New feature or request label Jul 1, 2022
@capricorn86
Copy link
Owner

Thanks for reporting! 馃檪

It seems like we are missing support for Node.compareDocumentPosition().

I will look into adding it as soon as possible. You are also very welcome to make a contribution if you want.

@castanonrodrigo
Copy link

Hi guys!
Is there any update on this?

@smarlhens
Copy link
Contributor Author

smarlhens commented Sep 30, 2022

Hi @castanonrodrigo, I have no news about the review so I published a new version on a private repository with my modifications not to be blocked and I override the package (in package.json) as follows "happy-dom": "npm:@<prefix>/happy-dom@6.1.0", with custom npm registry as default.

I guess @capricorn86 is working on #344 so maybe after he will take a look 馃檹馃徎

capricorn86 pushed a commit that referenced this issue Oct 7, 2022
* #524@minor: Add support for Node.compareDocumentPosition().

* #524@patch: Improves error handling if target is not set in Document.createProcessingInstruction().

* #524@trivial: Fixes unit tests.

Co-authored-by: David <david@pop-os.localdomain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants