You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
See #2528 (comment). Currently it seems people get stuck when seeing the error message "Descriptor for property toBeMocked is non-configurable and non-writable" and think this is some sort of error in Sinon.
Describe the solution you'd like
I was thinking that it might be useful to have error messages point directly to relevant docs that could give the user some context and possible hints at resolving the issue. So instead of "Descriptor for property toBeMocked is non-configurable and non-writable" change it to something like
The descriptor for the property toBeMocked is non-configurable and non-writable. Sinon cannot do anything about this, as it is essentially immutable. Read https://sinonjs.org/faqs#immutable-objectdescriptor for tips on what could cause this and how to possibly resolve it.
(The link is made up by the way). A fix should of course then include a new page in our docs that deals with that specific error. It could contain a short summary of possible reasons the descriptor is immutable (such as transpilation of ESM) and links to articles that show how to solve it.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
See #2528 (comment). Currently it seems people get stuck when seeing the error message "Descriptor for property toBeMocked is non-configurable and non-writable" and think this is some sort of error in Sinon.
Describe the solution you'd like
I was thinking that it might be useful to have error messages point directly to relevant docs that could give the user some context and possible hints at resolving the issue. So instead of "Descriptor for property toBeMocked is non-configurable and non-writable" change it to something like
(The link is made up by the way). A fix should of course then include a new page in our docs that deals with that specific error. It could contain a short summary of possible reasons the descriptor is immutable (such as transpilation of ESM) and links to articles that show how to solve it.
The text was updated successfully, but these errors were encountered: