constants.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', {
  3. value: true
  4. });
  5. exports.JEST_CONFIG_EXT_ORDER = exports.JEST_CONFIG_EXT_JSON = exports.JEST_CONFIG_EXT_TS = exports.JEST_CONFIG_EXT_JS = exports.JEST_CONFIG_EXT_MJS = exports.JEST_CONFIG_EXT_CJS = exports.JEST_CONFIG_BASE_NAME = exports.PACKAGE_JSON = exports.DEFAULT_REPORTER_LABEL = exports.DEFAULT_JS_PATTERN = exports.NODE_MODULES = void 0;
  6. function path() {
  7. const data = _interopRequireWildcard(require('path'));
  8. path = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. function _getRequireWildcardCache() {
  14. if (typeof WeakMap !== 'function') return null;
  15. var cache = new WeakMap();
  16. _getRequireWildcardCache = function () {
  17. return cache;
  18. };
  19. return cache;
  20. }
  21. function _interopRequireWildcard(obj) {
  22. if (obj && obj.__esModule) {
  23. return obj;
  24. }
  25. if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) {
  26. return {default: obj};
  27. }
  28. var cache = _getRequireWildcardCache();
  29. if (cache && cache.has(obj)) {
  30. return cache.get(obj);
  31. }
  32. var newObj = {};
  33. var hasPropertyDescriptor =
  34. Object.defineProperty && Object.getOwnPropertyDescriptor;
  35. for (var key in obj) {
  36. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  37. var desc = hasPropertyDescriptor
  38. ? Object.getOwnPropertyDescriptor(obj, key)
  39. : null;
  40. if (desc && (desc.get || desc.set)) {
  41. Object.defineProperty(newObj, key, desc);
  42. } else {
  43. newObj[key] = obj[key];
  44. }
  45. }
  46. }
  47. newObj.default = obj;
  48. if (cache) {
  49. cache.set(obj, newObj);
  50. }
  51. return newObj;
  52. }
  53. /**
  54. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  55. *
  56. * This source code is licensed under the MIT license found in the
  57. * LICENSE file in the root directory of this source tree.
  58. */
  59. const NODE_MODULES = path().sep + 'node_modules' + path().sep;
  60. exports.NODE_MODULES = NODE_MODULES;
  61. const DEFAULT_JS_PATTERN = '\\.[jt]sx?$';
  62. exports.DEFAULT_JS_PATTERN = DEFAULT_JS_PATTERN;
  63. const DEFAULT_REPORTER_LABEL = 'default';
  64. exports.DEFAULT_REPORTER_LABEL = DEFAULT_REPORTER_LABEL;
  65. const PACKAGE_JSON = 'package.json';
  66. exports.PACKAGE_JSON = PACKAGE_JSON;
  67. const JEST_CONFIG_BASE_NAME = 'jest.config';
  68. exports.JEST_CONFIG_BASE_NAME = JEST_CONFIG_BASE_NAME;
  69. const JEST_CONFIG_EXT_CJS = '.cjs';
  70. exports.JEST_CONFIG_EXT_CJS = JEST_CONFIG_EXT_CJS;
  71. const JEST_CONFIG_EXT_MJS = '.mjs';
  72. exports.JEST_CONFIG_EXT_MJS = JEST_CONFIG_EXT_MJS;
  73. const JEST_CONFIG_EXT_JS = '.js';
  74. exports.JEST_CONFIG_EXT_JS = JEST_CONFIG_EXT_JS;
  75. const JEST_CONFIG_EXT_TS = '.ts';
  76. exports.JEST_CONFIG_EXT_TS = JEST_CONFIG_EXT_TS;
  77. const JEST_CONFIG_EXT_JSON = '.json';
  78. exports.JEST_CONFIG_EXT_JSON = JEST_CONFIG_EXT_JSON;
  79. const JEST_CONFIG_EXT_ORDER = Object.freeze([
  80. JEST_CONFIG_EXT_JS,
  81. JEST_CONFIG_EXT_TS,
  82. JEST_CONFIG_EXT_MJS,
  83. JEST_CONFIG_EXT_CJS,
  84. JEST_CONFIG_EXT_JSON
  85. ]);
  86. exports.JEST_CONFIG_EXT_ORDER = JEST_CONFIG_EXT_ORDER;