1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.default = getNoTestsFoundMessage;
|
7 | var _getNoTestFound = _interopRequireDefault(require('./getNoTestFound'));
|
8 | var _getNoTestFoundFailed = _interopRequireDefault(
|
9 | require('./getNoTestFoundFailed')
|
10 | );
|
11 | var _getNoTestFoundPassWithNoTests = _interopRequireDefault(
|
12 | require('./getNoTestFoundPassWithNoTests')
|
13 | );
|
14 | var _getNoTestFoundRelatedToChangedFiles = _interopRequireDefault(
|
15 | require('./getNoTestFoundRelatedToChangedFiles')
|
16 | );
|
17 | var _getNoTestFoundVerbose = _interopRequireDefault(
|
18 | require('./getNoTestFoundVerbose')
|
19 | );
|
20 | function _interopRequireDefault(obj) {
|
21 | return obj && obj.__esModule ? obj : {default: obj};
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | function getNoTestsFoundMessage(testRunData, globalConfig) {
|
31 | const exitWith0 =
|
32 | globalConfig.passWithNoTests ||
|
33 | globalConfig.lastCommit ||
|
34 | globalConfig.onlyChanged;
|
35 | if (globalConfig.onlyFailures) {
|
36 | return {
|
37 | exitWith0,
|
38 | message: (0, _getNoTestFoundFailed.default)(globalConfig)
|
39 | };
|
40 | }
|
41 | if (globalConfig.onlyChanged) {
|
42 | return {
|
43 | exitWith0,
|
44 | message: (0, _getNoTestFoundRelatedToChangedFiles.default)(globalConfig)
|
45 | };
|
46 | }
|
47 | if (globalConfig.passWithNoTests) {
|
48 | return {
|
49 | exitWith0,
|
50 | message: (0, _getNoTestFoundPassWithNoTests.default)()
|
51 | };
|
52 | }
|
53 | return {
|
54 | exitWith0,
|
55 | message:
|
56 | testRunData.length === 1 || globalConfig.verbose
|
57 | ? (0, _getNoTestFoundVerbose.default)(
|
58 | testRunData,
|
59 | globalConfig,
|
60 | exitWith0
|
61 | )
|
62 | : (0, _getNoTestFound.default)(testRunData, globalConfig, exitWith0)
|
63 | };
|
64 | }
|