constants.js 2.9 KB

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