getNoTestsFoundMessage.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = getNoTestsFoundMessage;
  6. var _getNoTestFound = _interopRequireDefault(require('./getNoTestFound'));
  7. var _getNoTestFoundFailed = _interopRequireDefault(
  8. require('./getNoTestFoundFailed')
  9. );
  10. var _getNoTestFoundPassWithNoTests = _interopRequireDefault(
  11. require('./getNoTestFoundPassWithNoTests')
  12. );
  13. var _getNoTestFoundRelatedToChangedFiles = _interopRequireDefault(
  14. require('./getNoTestFoundRelatedToChangedFiles')
  15. );
  16. var _getNoTestFoundVerbose = _interopRequireDefault(
  17. require('./getNoTestFoundVerbose')
  18. );
  19. function _interopRequireDefault(obj) {
  20. return obj && obj.__esModule ? obj : {default: obj};
  21. }
  22. /**
  23. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  24. *
  25. * This source code is licensed under the MIT license found in the
  26. * LICENSE file in the root directory of this source tree.
  27. */
  28. function getNoTestsFoundMessage(testRunData, globalConfig) {
  29. if (globalConfig.onlyFailures) {
  30. return (0, _getNoTestFoundFailed.default)(globalConfig);
  31. }
  32. if (globalConfig.onlyChanged) {
  33. return (0, _getNoTestFoundRelatedToChangedFiles.default)(globalConfig);
  34. }
  35. if (globalConfig.passWithNoTests) {
  36. return (0, _getNoTestFoundPassWithNoTests.default)();
  37. }
  38. return testRunData.length === 1 || globalConfig.verbose
  39. ? (0, _getNoTestFoundVerbose.default)(testRunData, globalConfig)
  40. : (0, _getNoTestFound.default)(testRunData, globalConfig);
  41. }