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: Property onLine does not have access type get #755

Closed
CSchulz opened this issue Feb 15, 2023 · 0 comments · Fixed by #756
Closed

Error: Property onLine does not have access type get #755

CSchulz opened this issue Feb 15, 2023 · 0 comments · Fixed by #756
Labels
bug Something isn't working

Comments

@CSchulz
Copy link
Contributor

CSchulz commented Feb 15, 2023

Describe the bug
If you are switching from jsdom to happy-dom you will find differences in the implementation of how the navigator is used.

With jsdom you are able to use some spy on the navigator, happy-dom does not support it:

jest.spyOn(window.navigator, 'onLine', 'get').mockReturnValue(true);

To Reproduce
Add the code line to a spec and run it.

Expected behavior
A switch between jsdom and happy-dom should be possible without any changes in the source code.

Additional context
Compare with jsdom
https://github.com/jsdom/jsdom/blob/master/lib/jsdom/living/navigator/Navigator-impl.js
https://github.com/jsdom/jsdom/blob/master/lib/jsdom/living/navigator/NavigatorOnLine-impl.js

@CSchulz CSchulz added the bug Something isn't working label Feb 15, 2023
CSchulz added a commit to CSchulz/happy-dom that referenced this issue Feb 15, 2023
CSchulz added a commit to CSchulz/happy-dom that referenced this issue Feb 15, 2023
CSchulz added a commit to CSchulz/happy-dom that referenced this issue Feb 15, 2023
capricorn86 added a commit that referenced this issue Feb 16, 2023
#755@patch: Replace properties by getter in Navigator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant