-
Notifications
You must be signed in to change notification settings - Fork 17
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
window.navigator.userAgent cannot be mocked #585
Comments
As a workaround, I found that sinon can be used to get around this issue (though it's not quite ideal, as one would expect Here's an example for anyone else having this issue:
|
Hm, that is weird. There is an explicit test for this here. Just to make sure, |
Yes, there's an explicit import and it worked in 0.8.1 but fails in 1.0.2. |
BTW even though I filed this at the same time as #586, they are occurring independently in two separate addons, not the same project. So these issues have been reproducible for me across multiple projects that were already using ember-window-mock 0.8.1 successfully. |
Here's a full look at what I have (this is a test util in an addon's test-support folder):
Package versions: |
Still sounds very much like the same root cause. The only significant change has been the conversion to v2. Which makes ember-auto-import handle the addon. Any chance you could test this with the latest version of that? |
Even with ember-auto-import 2.8.1, the window object does not seem to get proxied by setupWndowMock |
@elwayman02 would you be able to provide a simple reproduction repo? Still failing to understand why it would not work for you while it is working in this repo's test-app... |
Seeing the following error when upgrading from v0.8.1 to v1.0.2:
Cannot set property userAgent of #<Navigator> which has only a getter
Here's an example of our code:
The text was updated successfully, but these errors were encountered: