Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

jest.config.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2023 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. const babelConfig = require('./babel.config');
  21. babelConfig.presets = [
  22. ['@babel/preset-env', { targets: { node: 'current' } }],
  23. '@babel/preset-typescript',
  24. ];
  25. module.exports = {
  26. coverageDirectory: '<rootDir>/coverage',
  27. collectCoverageFrom: [
  28. 'src/components/**/*.{ts,tsx,js}',
  29. 'src/helpers/**/*.{ts,tsx,js}',
  30. '!src/helpers/{keycodes,testUtils}.{ts,tsx}',
  31. ],
  32. coverageReporters: ['lcovonly', 'text'],
  33. globals: {
  34. 'ts-jest': {
  35. diagnostics: false,
  36. },
  37. },
  38. moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
  39. moduleNameMapper: {
  40. '^.+\\.(md|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
  41. '<rootDir>/config/jest/FileStub.js',
  42. // '^.+\\.css$': '<rootDir>/config/jest/CSSStub.js',
  43. },
  44. setupFiles: [
  45. '<rootDir>/config/jest/SetupTestEnvironment.js',
  46. '<rootDir>/config/jest/SetupTheme.js',
  47. ],
  48. setupFilesAfterEnv: ['<rootDir>/config/jest/SetupReactTestingLibrary.ts'],
  49. snapshotSerializers: ['@emotion/jest/serializer'],
  50. testEnvironment: 'jsdom',
  51. testPathIgnorePatterns: ['<rootDir>/config/jest', '<rootDir>/node_modules', '<rootDir>/scripts'],
  52. testRegex: '(/__tests__/.*|\\-test)\\.(ts|tsx|js)$',
  53. transform: {
  54. '^.+\\.(t|j)sx?$': ['babel-jest', babelConfig],
  55. },
  56. transformIgnorePatterns: ['/node_modules/(?!(d3-.+))/'],
  57. testTimeout: 30000,
  58. };