getNoTestFoundRelatedToChangedFiles.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = getNoTestFoundRelatedToChangedFiles;
  6. function _chalk() {
  7. const data = _interopRequireDefault(require('chalk'));
  8. _chalk = function _chalk() {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _jestUtil() {
  14. const data = require('jest-util');
  15. _jestUtil = function _jestUtil() {
  16. return data;
  17. };
  18. return data;
  19. }
  20. function _interopRequireDefault(obj) {
  21. return obj && obj.__esModule ? obj : {default: obj};
  22. }
  23. /**
  24. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  25. *
  26. * This source code is licensed under the MIT license found in the
  27. * LICENSE file in the root directory of this source tree.
  28. */
  29. function getNoTestFoundRelatedToChangedFiles(globalConfig) {
  30. const ref = globalConfig.changedSince
  31. ? `"${globalConfig.changedSince}"`
  32. : 'last commit';
  33. let msg = _chalk().default.bold(
  34. `No tests found related to files changed since ${ref}.`
  35. );
  36. if (_jestUtil().isInteractive) {
  37. msg += _chalk().default.dim(
  38. '\n' +
  39. (globalConfig.watch
  40. ? 'Press `a` to run all tests, or run Jest with `--watchAll`.'
  41. : 'Run Jest without `-o` or with `--all` to run all tests.')
  42. );
  43. }
  44. return msg;
  45. }