Skip to content

Commit

Permalink
Fix regular expression for matching message for findMessageType (#7029)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alcedo Nathaniel De Guzman Jr authored and SimenB committed Sep 23, 2018
1 parent df78b49 commit 37caedd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/jest-editor-support/src/Runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default class Runner extends EventEmitter {

findMessageType(buf: Buffer): MessageType {
const str = buf.toString('utf8', 0, 58);
const lastCommitRegex = /No tests found related to files changed since ((last commit)|([a-z0-9]+))./;
const lastCommitRegex = /No tests found related to files changed since ((last commit)|("[a-z0-9]+"))./;
if (lastCommitRegex.test(str)) {
return messageTypes.noTests;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-editor-support/src/__tests__/runner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ describe('events', () => {

it('should track when "No tests found related to files changed since master" is received', () => {
const data = Buffer.from(
'No tests found related to files changed since master.\n' +
'No tests found related to files changed since "master".\n' +
'Press `a` to run all tests, or run Jest with `--watchAll`.',
);
fakeProcess.stderr.emit('data', data);
Expand Down Expand Up @@ -496,7 +496,7 @@ describe('events', () => {

it('should identify "No tests found related to files changed since git ref."', () => {
const buf = Buffer.from(
'No tests found related to files changed since master.\n' +
'No tests found related to files changed since "master".\n' +
'Press `a` to run all tests, or run Jest with `--watchAll`.',
);
expect(runner.findMessageType(buf)).toBe(messageTypes.noTests);
Expand Down

0 comments on commit 37caedd

Please sign in to comment.