github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/jest.config.js (about)

     1  const path = require('path');
     2  
     3  module.exports = {
     4    // TypeScript files (.ts, .tsx) will be transformed by ts-jest to CommonJS syntax, and JavaScript files (.js, jsx) will be transformed by babel-jest.
     5    testEnvironment: 'jsdom',
     6    setupFilesAfterEnv: [path.join(__dirname, 'setupAfterEnv.ts')],
     7    testMatch: [
     8      '**/__tests__/**/*.+(ts|tsx|js)',
     9      '**/?(*.)+(spec|test).+(ts|tsx|js)',
    10    ],
    11    moduleNameMapper: {
    12      '@webapp(.*)$': path.join(__dirname, 'webapp/javascript/$1'),
    13    },
    14    transform: {
    15      '\\.module\\.(css|scss)$': 'jest-css-modules-transform',
    16      '\\.(css|scss)$': 'jest-css-modules-transform',
    17      '\\.svg$': path.join(__dirname, 'svg-transform.js'),
    18      '^.+\\.(t|j)sx?$': ['@swc/jest'],
    19    },
    20    transformIgnorePatterns: [
    21      // force us to not transpile these dependencies
    22      // https://stackoverflow.com/a/69150188
    23      'node_modules/(?!(true-myth|d3|d3-array|internmap|d3-scale|react-notifications-component|graphviz-react))',
    24    ],
    25    globalSetup: '<rootDir>/globalSetup.js',
    26    globalTeardown: '<rootDir>/globalTeardown.js',
    27  };