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
The reason it throws an error is because the necessary this binding is lost when calling use via the above syntax as opposed to calling it via chai.use(sinonChai).
I'd argue that it's unexpected and undesirable for a singleton module to utilize this in such a way.
One possible solution might be to change use from:
Looks good to me.
Since this and exports refer to the same object (which is the chai module which is being exported by this file) I can't see any other side effects for this.
Nice catch 👍
The following code throws an error:
The reason it throws an error is because the necessary
this
binding is lost when callinguse
via the above syntax as opposed to calling it viachai.use(sinonChai)
.I'd argue that it's unexpected and undesirable for a singleton module to utilize
this
in such a way.One possible solution might be to change use from:
To:
The text was updated successfully, but these errors were encountered: