Skip to content
Snippets Groups Projects
jest.config.js 1.21 KiB
Newer Older
  • Learn to ignore specific revisions
  • /** @type {import('jest').Config} */
    const config = {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
      testURL: 'http://localhost/',
      moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'styl'],
    
      setupFilesAfterEnv: ['<rootDir>/tests/jestLib/setupTests.ts'],
    
      moduleDirectories: ['<rootDir>', 'node_modules'],
      modulePaths: ['<rootDir>/src'],
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
      moduleNameMapper: {
    
        '\\.(png|gif|jpe?g|svg|hbs)$': '<rootDir>/tests/__mocks__/fileMock.js',
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
        // identity-obj-proxy module is installed by cozy-scripts
    
        '\\.(css|styl|sass|scss)$': 'identity-obj-proxy',
    
        d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
        '^d3-(.*)$': '<rootDir>/node_modules/d3-$1/dist/d3-$1.min.js',
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
      },
      transformIgnorePatterns: [
        'node_modules/(?!(cozy-ui|cozy-harvest-lib|cozy-client))',
      ],
      transform: {
        // babel-jest module is installed by cozy-scripts
        '^.+\\.(js|jsx|ts|tsx)?$': 'babel-jest',
      },
      globals: {
        __ALLOW_HTTP__: false,
        __TARGET__: 'browser',
    
        __PIWIK_TRACKER_URL__: 'http://localhost:9800/',
    
        __SAU_LINK__:
          'https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/-/issues',
        __SAU_IDEA_DIRECT_LINK__:
          'https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo/-/issues',
    
    Yoan VALLET's avatar
    Yoan VALLET committed
        cozy: {},
    
    Yoan VALLET's avatar
    Yoan VALLET committed
      },
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    }
    
    
    module.exports = config