Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5079 from nex3/exit-code
Properly set the errored property for --report options
- Loading branch information
Showing
9 changed files
with
211 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`fs - errored state for reportNeedlessDisables 1`] = ` | ||
Object { | ||
"errored": true, | ||
"output": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [ | ||
Object { | ||
"column": 1, | ||
"line": 1, | ||
"rule": "--report-needless-disables", | ||
"severity": "error", | ||
"text": "Needless disable for \\"block-no-empty\\"", | ||
}, | ||
], | ||
}, | ||
], | ||
"reportedDisables": Array [], | ||
"results": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"ignored": undefined, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [ | ||
Object { | ||
"column": 1, | ||
"line": 1, | ||
"rule": "--report-needless-disables", | ||
"severity": "error", | ||
"text": "Needless disable for \\"block-no-empty\\"", | ||
}, | ||
], | ||
}, | ||
], | ||
} | ||
`; | ||
|
||
exports[`fs - no errored state 1`] = ` | ||
Object { | ||
"errored": false, | ||
"output": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [], | ||
}, | ||
], | ||
"reportedDisables": Array [], | ||
"results": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"ignored": undefined, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [], | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`no-fs - errored state for reportNeedlessDisables 1`] = ` | ||
Object { | ||
"errored": true, | ||
"output": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [ | ||
Object { | ||
"column": 1, | ||
"line": 1, | ||
"rule": "--report-needless-disables", | ||
"severity": "error", | ||
"text": "Needless disable for \\"block-no-empty\\"", | ||
}, | ||
], | ||
}, | ||
], | ||
"reportedDisables": Array [], | ||
"results": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"ignored": undefined, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [ | ||
Object { | ||
"column": 1, | ||
"line": 1, | ||
"rule": "--report-needless-disables", | ||
"severity": "error", | ||
"text": "Needless disable for \\"block-no-empty\\"", | ||
}, | ||
], | ||
}, | ||
], | ||
} | ||
`; | ||
|
||
exports[`no-fs - no errored state 1`] = ` | ||
Object { | ||
"errored": false, | ||
"output": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [], | ||
}, | ||
], | ||
"reportedDisables": Array [], | ||
"results": Array [ | ||
Object { | ||
"deprecations": Array [], | ||
"errored": false, | ||
"ignored": undefined, | ||
"invalidOptionWarnings": Array [], | ||
"parseErrors": Array [], | ||
"warnings": Array [], | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"block-no-empty": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const stylelint = require('../../lib'); | ||
const { caseConfigFile, caseFilesForFix, prepForSnapshot } = require('../systemTestUtils'); | ||
|
||
const CASE_NUMBER = '004'; | ||
|
||
it('fs - errored state for reportNeedlessDisables', async () => { | ||
expect( | ||
prepForSnapshot( | ||
await stylelint.lint({ | ||
files: await caseFilesForFix(CASE_NUMBER), | ||
configFile: caseConfigFile(CASE_NUMBER), | ||
reportNeedlessDisables: true, | ||
}), | ||
), | ||
).toMatchSnapshot(); | ||
}, 10000); | ||
|
||
it('fs - no errored state', async () => { | ||
expect( | ||
prepForSnapshot( | ||
await stylelint.lint({ | ||
files: await caseFilesForFix(CASE_NUMBER), | ||
configFile: caseConfigFile(CASE_NUMBER), | ||
}), | ||
), | ||
).toMatchSnapshot(); | ||
}, 10000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const stylelint = require('../../lib'); | ||
const { caseConfig, caseCode, prepForSnapshot } = require('../systemTestUtils'); | ||
|
||
const CASE_NUMBER = '004'; | ||
|
||
it('no-fs - errored state for reportNeedlessDisables', async () => { | ||
expect( | ||
prepForSnapshot( | ||
await stylelint.lint({ | ||
code: await caseCode(CASE_NUMBER), | ||
config: await caseConfig(CASE_NUMBER), | ||
reportNeedlessDisables: true, | ||
}), | ||
), | ||
).toMatchSnapshot(); | ||
}, 10000); | ||
|
||
it('no-fs - no errored state', async () => { | ||
expect( | ||
prepForSnapshot( | ||
await stylelint.lint({ | ||
code: await caseCode(CASE_NUMBER), | ||
config: await caseConfig(CASE_NUMBER), | ||
}), | ||
), | ||
).toMatchSnapshot(); | ||
}, 10000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* stylelint-disable block-no-empty */ | ||
a { | ||
color: red; | ||
} |