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
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
The no-describe-variables rule prevents developers from creating variables inside describe blocks, instead encouraging them to make use of Jasmine's user context feature (this inside before*, it, and after*). However, developers may not know that the user context feature doesn't work inside describe blocks, so they may try to do something like this:
Not only is this incorrect, it is dangerous, as the context of describe blocks is the Jasmine Suite object itself. Setting a property on this object may interfere with Jasmine's internals (e.g., setting this.result will overwrite the test results, setting this.id changes the id of the suite, etc.).
What is the expected behavior?
An eslint-plugin-jasmine rule called no-describe-context should prevent this behavior. Detect and warn about usage of this directly inside describe blocks (probably only for un-bound / non-arrow functions).
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
The
no-describe-variables
rule prevents developers from creating variables insidedescribe
blocks, instead encouraging them to make use of Jasmine's user context feature (this
insidebefore*
,it
, andafter*
). However, developers may not know that the user context feature doesn't work insidedescribe
blocks, so they may try to do something like this:Not only is this incorrect, it is dangerous, as the context of
describe
blocks is the JasmineSuite
object itself. Setting a property on this object may interfere with Jasmine's internals (e.g., settingthis.result
will overwrite the test results, settingthis.id
changes the id of the suite, etc.).What is the expected behavior?
An
eslint-plugin-jasmine
rule calledno-describe-context
should prevent this behavior. Detect and warn about usage ofthis
directly insidedescribe
blocks (probably only for un-bound / non-arrow functions).The text was updated successfully, but these errors were encountered: