forked from jestjs/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.
testPathPattern message test (jestjs#4006)
- Loading branch information
1 parent
24e773c
commit 3b9da7b
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
integration_tests/__tests__/test_path_pattern_reporter_message.test.js
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,44 @@ | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import runJest from '../runJest'; | ||
import {cleanup, writeFiles} from '../utils'; | ||
import os from 'os'; | ||
import path from 'path'; | ||
|
||
const skipOnWindows = require('skipOnWindows'); | ||
const DIR = path.resolve(os.tmpdir(), 'jest_path_pattern_reporter_message'); | ||
|
||
skipOnWindows.suite(); | ||
|
||
beforeEach(() => cleanup(DIR)); | ||
afterEach(() => cleanup(DIR)); | ||
|
||
test('prints a message with path pattern at the end', () => { | ||
writeFiles(DIR, { | ||
'.watchmanconfig': '', | ||
'__tests__/a.test.js': `test('a', () => {});`, | ||
'__tests__/b.test.js': `test('b', () => {});`, | ||
'package.json': '{}', | ||
}); | ||
let stderr; | ||
|
||
({stderr} = runJest(DIR, ['a'])); | ||
expect(stderr).toMatch('Ran all test suites matching "a"'); | ||
|
||
({stderr} = runJest(DIR, ['a', 'b'])); | ||
expect(stderr).toMatch('Ran all test suites matching /a|b/'); | ||
|
||
({stderr} = runJest(DIR, ['--testPathPattern', 'a'])); | ||
expect(stderr).toMatch('Ran all test suites matching /a/'); | ||
|
||
({stderr} = runJest(DIR, ['--testPathPattern', 'a|b'])); | ||
expect(stderr).toMatch('Ran all test suites matching /a|b/'); | ||
}); |