Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows watch mode fix #3563

Merged
merged 9 commits into from
May 17, 2017
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/jest-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"micromatch": "^2.3.11",
"node-notifier": "^5.0.2",
"pify": "^2.3.0",
"regex-slash": "^1.0.1",
"slash": "^1.0.0",
"string-length": "^1.0.1",
"throat": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'use strict';

const chalk = require('chalk');
const rslash = require('regex-slash');
const {KEYS} = require('../constants');

const runJestMock = jest.fn();
Expand Down Expand Up @@ -164,7 +165,7 @@ describe('Watch mode flows', () => {

stdin.emit(KEYS.ENTER);

expect(argv.testPathPattern).toMatchSnapshot();
expect(rslash(argv.testPathPattern)).toMatchSnapshot();
});

it('Results in pattern mode get truncated appropriately', () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/jest-cli/src/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import type {Context} from 'types/Context';

const ansiEscapes = require('ansi-escapes');
const chalk = require('chalk');
const createContext = require('./lib/createContext');
const HasteMap = require('jest-haste-map');
const isCI = require('is-ci');
const createContext = require('./lib/createContext');
const isValidPath = require('./lib/isValidPath');
const preRunMessage = require('./preRunMessage');
const replacePathSepForRegex = require('jest-regex-util').replacePathSepForRegex;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: const {replacePathSepForRegex} = require('jest-regex-util');

const runJest = require('./runJest');
const updateArgv = require('./lib/updateArgv');
const SearchSource = require('./SearchSource');
Expand Down Expand Up @@ -201,7 +202,7 @@ const watch = (
testPathPattern => {
updateArgv(argv, 'watch', {
testNamePattern: '',
testPathPattern,
testPathPattern: replacePathSepForRegex(testPathPattern),
});

startRun();
Expand Down