The TerraDescribeViewportsBlockingInspection reports when the viewports arguments in a Terra.describeViewports is not an array, however it may be extracted to a constant/variable or retrieved from somewhere else too.
Create a constant and set it to an array of viewport values, e.g. ['tiny','huge']
Create a Terra.describeViewports block.
Set the constant as the viewports argument to this block.
Expected results
No violation reported.
Actual results
The viewports argument is marked as erroneous because it is not an array-type.
Technical notes
Update com.picimako.terra.wdio.viewports.inspection.TerraDescribeViewportsBlockingInspection to better handle the type of the viewports argument.
Resolve potential references (e.g. to constants) and determine their type.
Report problem only when either the viewports argument is either explicitly an array, or the resolved constant is set with an array-type value.
Rename the display name of this inspection in the plugin.xml to better reflect what it does.
Steps to reproduce
The
TerraDescribeViewportsBlockingInspection
reports when the viewports arguments in aTerra.describeViewports
is not an array, however it may be extracted to a constant/variable or retrieved from somewhere else too.['tiny','huge']
Terra.describeViewports
block.Expected results
No violation reported.
Actual results
The viewports argument is marked as erroneous because it is not an array-type.
Technical notes
com.picimako.terra.wdio.viewports.inspection.TerraDescribeViewportsBlockingInspection
to better handle the type of the viewports argument.Versions affected
<= 0.4.1
Out of scope