-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add fix command that applies fix property from rule * Support --fix flag * Fix tests * Reintroduce some sad path tests * Add tests for new fix option * Add docs * Enable more tests * Add no fix found test * Add tests for extracted setOutputMode helper * Update no fix found error message * Fix tests
- Loading branch information
Showing
13 changed files
with
336 additions
and
119 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { SolidarityOutputMode } from '../../src/types' | ||
import setOutputMode from '../../src/extensions/functions/setOutputMode' | ||
|
||
test('default output mode', () => { | ||
const params = { options: {} } | ||
const settings = {} | ||
const result = setOutputMode(params, settings) | ||
|
||
expect(result).toEqual(SolidarityOutputMode.MODERATE) | ||
}) | ||
|
||
test('settings output mode', () => { | ||
const params = { options: {} } | ||
const settings = { config: { output: 'SILENT' } } | ||
const result = setOutputMode(params, settings) | ||
|
||
expect(result).toEqual(SolidarityOutputMode.SILENT) | ||
}) | ||
|
||
test('verbose output mode', () => { | ||
const params = { options: { verbose: true } } | ||
const settings = {} | ||
const result = setOutputMode(params, settings) | ||
|
||
expect(result).toEqual(SolidarityOutputMode.VERBOSE) | ||
}) | ||
|
||
test('silent output mode', () => { | ||
const params = { options: { silent: true } } | ||
const settings = {} | ||
const result = setOutputMode(params, settings) | ||
|
||
expect(result).toEqual(SolidarityOutputMode.SILENT) | ||
}) | ||
|
||
test('moderate output mode', () => { | ||
const params = { options: { moderate: true } } | ||
const settings = {} | ||
const result = setOutputMode(params, settings) | ||
|
||
expect(result).toEqual(SolidarityOutputMode.MODERATE) | ||
}) |
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
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
Oops, something went wrong.