Deprecated.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 = 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().format)(value, {
  31. min: true
  32. });
  33. const deprecatedOptions = {
  34. browser: () =>
  35. ` Option ${_chalk().default.bold(
  36. '"browser"'
  37. )} has been deprecated. Please install "browser-resolve" and use the "resolver" option in Jest configuration as shown in the documentation: https://jestjs.io/docs/configuration#resolver-string`,
  38. preprocessorIgnorePatterns: options => ` Option ${_chalk().default.bold(
  39. '"preprocessorIgnorePatterns"'
  40. )} was replaced by ${_chalk().default.bold(
  41. '"transformIgnorePatterns"'
  42. )}, which support multiple preprocessors.
  43. Jest now treats your current configuration as:
  44. {
  45. ${_chalk().default.bold(
  46. '"transformIgnorePatterns"'
  47. )}: ${_chalk().default.bold(format(options.preprocessorIgnorePatterns))}
  48. }
  49. Please update your configuration.`,
  50. scriptPreprocessor: options => ` Option ${_chalk().default.bold(
  51. '"scriptPreprocessor"'
  52. )} was replaced by ${_chalk().default.bold(
  53. '"transform"'
  54. )}, which support multiple preprocessors.
  55. Jest now treats your current configuration as:
  56. {
  57. ${_chalk().default.bold('"transform"')}: ${_chalk().default.bold(
  58. `{".*": ${format(options.scriptPreprocessor)}}`
  59. )}
  60. }
  61. Please update your configuration.`,
  62. setupTestFrameworkScriptFile: _options => ` Option ${_chalk().default.bold(
  63. '"setupTestFrameworkScriptFile"'
  64. )} was replaced by configuration ${_chalk().default.bold(
  65. '"setupFilesAfterEnv"'
  66. )}, which supports multiple paths.
  67. Please update your configuration.`,
  68. testPathDirs: options => ` Option ${_chalk().default.bold(
  69. '"testPathDirs"'
  70. )} was replaced by ${_chalk().default.bold('"roots"')}.
  71. Jest now treats your current configuration as:
  72. {
  73. ${_chalk().default.bold('"roots"')}: ${_chalk().default.bold(
  74. format(options.testPathDirs)
  75. )}
  76. }
  77. Please update your configuration.
  78. `
  79. };
  80. var _default = deprecatedOptions;
  81. exports.default = _default;