-
-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `--shell` disables parsing of command strings, enabling advanced shell scripts at the cost of speed and security - `--quiet` disabled _lint-staged_'s own console progress output, leaving only the linter commandss
- Loading branch information
Showing
11 changed files
with
146 additions
and
37 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
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,41 @@ | ||
import Listr from 'listr' | ||
import path from 'path' | ||
|
||
// silence console from Jest output | ||
console.log = jest.fn(() => {}) | ||
console.error = jest.fn(() => {}) | ||
|
||
jest.mock('listr') | ||
|
||
// eslint-disable-next-line import/first | ||
import lintStaged from '../src/index' | ||
|
||
describe('lintStaged', () => { | ||
afterEach(() => { | ||
Listr.mockClear() | ||
}) | ||
|
||
it('should pass silent flag to Listr', async () => { | ||
expect.assertions(1) | ||
await lintStaged( | ||
console, | ||
path.join(__dirname, '__mocks__', 'my-config.json'), | ||
false, | ||
true, | ||
false | ||
) | ||
expect(Listr.mock.calls[0][1]).toEqual({ dateFormat: false, renderer: 'silent' }) | ||
}) | ||
|
||
it('should pass debug flag to Listr', async () => { | ||
expect.assertions(1) | ||
await lintStaged( | ||
console, | ||
path.join(__dirname, '__mocks__', 'my-config.json'), | ||
false, | ||
false, | ||
true | ||
) | ||
expect(Listr.mock.calls[0][1]).toEqual({ dateFormat: false, renderer: 'verbose' }) | ||
}) | ||
}) |
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.