Deprecated.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _chalk() {
  7. const data = _interopRequireDefault(require('chalk'));
  8. _chalk = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _prettyFormat() {
  14. const data = _interopRequireDefault(require('pretty-format'));
  15. _prettyFormat = function () {
  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. const format = value =>
  30. (0, _prettyFormat().default)(value, {
  31. min: true
  32. });
  33. const deprecatedOptions = {
  34. browser: () => ` Option ${_chalk().default.bold(
  35. '"browser"'
  36. )} has been deprecated. Please install "browser-resolve" and use the "resolver" option in Jest configuration as follows:
  37. {
  38. ${_chalk().default.bold('"resolver"')}: ${_chalk().default.bold(
  39. '"browser-resolve"'
  40. )}
  41. }
  42. `,
  43. mapCoverage: () => ` Option ${_chalk().default.bold(
  44. '"mapCoverage"'
  45. )} has been removed, as it's no longer necessary.
  46. Please update your configuration.`,
  47. preprocessorIgnorePatterns: options => ` Option ${_chalk().default.bold(
  48. '"preprocessorIgnorePatterns"'
  49. )} was replaced by ${_chalk().default.bold(
  50. '"transformIgnorePatterns"'
  51. )}, which support multiple preprocessors.
  52. Jest now treats your current configuration as:
  53. {
  54. ${_chalk().default.bold(
  55. '"transformIgnorePatterns"'
  56. )}: ${_chalk().default.bold(format(options.preprocessorIgnorePatterns))}
  57. }
  58. Please update your configuration.`,
  59. scriptPreprocessor: options => ` Option ${_chalk().default.bold(
  60. '"scriptPreprocessor"'
  61. )} was replaced by ${_chalk().default.bold(
  62. '"transform"'
  63. )}, which support multiple preprocessors.
  64. Jest now treats your current configuration as:
  65. {
  66. ${_chalk().default.bold('"transform"')}: ${_chalk().default.bold(
  67. `{".*": ${format(options.scriptPreprocessor)}}`
  68. )}
  69. }
  70. Please update your configuration.`,
  71. setupTestFrameworkScriptFile: _options => ` Option ${_chalk().default.bold(
  72. '"setupTestFrameworkScriptFile"'
  73. )} was replaced by configuration ${_chalk().default.bold(
  74. '"setupFilesAfterEnv"'
  75. )}, which supports multiple paths.
  76. Please update your configuration.`,
  77. testPathDirs: options => ` Option ${_chalk().default.bold(
  78. '"testPathDirs"'
  79. )} was replaced by ${_chalk().default.bold('"roots"')}.
  80. Jest now treats your current configuration as:
  81. {
  82. ${_chalk().default.bold('"roots"')}: ${_chalk().default.bold(
  83. format(options.testPathDirs)
  84. )}
  85. }
  86. Please update your configuration.
  87. `
  88. };
  89. var _default = deprecatedOptions;
  90. exports.default = _default;