ESLintUnitTest
extends AbstractSniffUnitTest
in package
FinalYes
Unit test class for the ESLint sniff.
Tags
Table of Contents
Constants
- ESLINT_CONFIG = '{ "parserOptions": { "ecmaVersion": 5, "sourceType": "script", "ecmaFeatures": {} }, "rules": { "no-undef": 2, "no-unused-vars": 2 } }'
- Basic ESLint config to use for testing the sniff.
Methods
- getErrorList() : array<int, int>
- Returns the lines where errors should occur.
- getWarningList() : array<int, int>
- Returns the lines where warnings should occur.
- resetProperties() : void
- Remove artifact.
- setUpPrerequisites() : void
- Sets up this unit test.
- shouldSkipTest() : bool
- Should this test be skipped for some reason.
Constants
ESLINT_CONFIG
Basic ESLint config to use for testing the sniff.
public
string
ESLINT_CONFIG
= '{
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script",
"ecmaFeatures": {}
},
"rules": {
"no-undef": 2,
"no-unused-vars": 2
}
}'
Methods
getErrorList()
Returns the lines where errors should occur.
public
getErrorList() : array<int, int>
The key of the array should represent the line number and the value should represent the number of errors that should occur on that line.
Return values
array<int, int>getWarningList()
Returns the lines where warnings should occur.
public
getWarningList() : array<int, int>
The key of the array should represent the line number and the value should represent the number of warnings that should occur on that line.
Return values
array<int, int>resetProperties()
Remove artifact.
protected
resetProperties() : void
Tags
setUpPrerequisites()
Sets up this unit test.
protected
setUpPrerequisites() : void
Tags
shouldSkipTest()
Should this test be skipped for some reason.
protected
shouldSkipTest() : bool