forked from jest-community/vscode-jest
-
Notifications
You must be signed in to change notification settings - Fork 0
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 jest-community#329 from seanpoulter/feature/jest-c…
…ommunity#327/All-tests-should-not-rerun When --watch is not supported, restart with --watchAll
- Loading branch information
Showing
8 changed files
with
119 additions
and
97 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,8 @@ | ||
export enum WatchMode { | ||
None = 'none', | ||
Watch = 'watch', | ||
WatchAll = 'watchAll', | ||
} | ||
|
||
export const isWatchNotSupported = (str = '') => | ||
new RegExp('^s*--watch is not supported without git/hg, please use --watchAlls*', 'im').test(str) |
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,13 @@ | ||
jest.unmock('../../src/Jest') | ||
import { isWatchNotSupported } from '../../src/Jest' | ||
|
||
describe('isWatchNotSupported', () => { | ||
it('returns true when matching the expected message', () => { | ||
const str = '\n--watch is not supported without git/hg, please use --watchAll \n' | ||
expect(isWatchNotSupported(str)).toBe(true) | ||
}) | ||
|
||
it('returns false otherwise', () => { | ||
expect(isWatchNotSupported()).toBe(false) | ||
}) | ||
}) |
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.