|
13 | 13 | const path = require('path'); |
14 | 14 | const runJest = require('../runJest'); |
15 | 15 |
|
16 | | -const DIR = path.resolve(__dirname, '../fail_with_no_tests'); |
| 16 | +const DIR = path.resolve(__dirname, '../pass_with_no_tests-test'); |
17 | 17 |
|
18 | | -describe('jest --failWithNoTests', () => { |
19 | | - test("doesn't fail the test suite if no files are found", () => { |
| 18 | +describe('jest --passWithNoTests', () => { |
| 19 | + test('fails the test suite if no files are found', () => { |
20 | 20 | const result = runJest(DIR, ['--testPathPattern', '/non/existing/path/']); |
21 | 21 | const status = result.status; |
22 | 22 | const stdout = result.stdout.toString(); |
23 | 23 |
|
24 | 24 | expect(stdout).toMatch('No tests found'); |
25 | | - expect(status).toBe(0); |
| 25 | + expect(status).toBe(1); |
26 | 26 | }); |
27 | 27 |
|
28 | | - test('fails the test suite if no files are found', () => { |
| 28 | + test("doesn't fail the test suite if no files are found", () => { |
29 | 29 | const result = runJest(DIR, [ |
30 | 30 | '--testPathPattern', |
31 | 31 | '/non/existing/path/', |
32 | | - '--failWithNoTests', |
| 32 | + '--passWithNoTests', |
33 | 33 | ]); |
34 | 34 | const status = result.status; |
35 | 35 | const stdout = result.stdout.toString(); |
36 | 36 |
|
37 | 37 | expect(stdout).toMatch('No tests found'); |
38 | | - expect(status).toBe(1); |
| 38 | + expect(status).toBe(0); |
39 | 39 | }); |
40 | 40 | }); |
0 commit comments