Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

jest.config.js 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2024 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/hooks/**/*.{ts,tsx,js}',
  31. 'src/sonar-aligned/**/*.{ts,tsx,js}',
  32. '!src/helpers/{keycodes,testUtils}.{ts,tsx}',
  33. ],
  34. coverageReporters: ['lcovonly', 'text'],
  35. globals: {
  36. 'ts-jest': {
  37. diagnostics: false,
  38. },
  39. },
  40. moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
  41. moduleNameMapper: {
  42. '^.+\\.(md|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
  43. '<rootDir>/config/jest/FileStub.js',
  44. // '^.+\\.css$': '<rootDir>/config/jest/CSSStub.js',
  45. },
  46. setupFiles: [
  47. '<rootDir>/config/jest/SetupTestEnvironment.js',
  48. '<rootDir>/config/jest/SetupTheme.js',
  49. ],
  50. setupFilesAfterEnv: [
  51. '<rootDir>/config/jest/SetupReactTestingLibrary.ts',
  52. '<rootDir>/../config/jest/SetupFailOnConsole.ts',
  53. ],
  54. snapshotSerializers: ['@emotion/jest/serializer'],
  55. testEnvironment: 'jsdom',
  56. testPathIgnorePatterns: [
  57. '<rootDir>/config/jest',
  58. '<rootDir>/node_modules',
  59. '<rootDir>/scripts',
  60. '<rootDir>/lib',
  61. ],
  62. testRegex: '(/__tests__/.*|\\-test)\\.(ts|tsx|js)$',
  63. transform: {
  64. '^.+\\.(t|j)sx?$': ['babel-jest', babelConfig],
  65. },
  66. transformIgnorePatterns: ['/node_modules/(?!(d3-.+))/'],
  67. reporters: [
  68. 'default',
  69. [
  70. '../config/jest/DataDogReporter.js',
  71. {
  72. outputFilepath: '/tmp/ut-ts-designsystem-test-monitoring.log',
  73. },
  74. ],
  75. ],
  76. testTimeout: 60000,
  77. };