您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

jest.config.js 692B

1234567891011121314151617181920
  1. module.exports = {
  2. roots: ['<rootDir>'],
  3. testEnvironment: 'jsdom',
  4. moduleFileExtensions: ['ts', 'tsx', 'mjs', 'js', 'json', 'jsx'],
  5. testPathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|.next)[/\\\\]'],
  6. transformIgnorePatterns: ['node_modules/(?!(browser-fs-access)/)'],
  7. transform: {
  8. '^.+\\.(ts|tsx|mjs)$': 'babel-jest',
  9. },
  10. modulePaths: ['<rootDir>', 'node_modules'],
  11. testMatch: ['**/__tests__/**/*test.[t]s?(x)'],
  12. watchPlugins: [
  13. 'jest-watch-typeahead/filename',
  14. 'jest-watch-typeahead/testname',
  15. ],
  16. moduleNameMapper: {
  17. '\\.(css|less|sass|scss)$': 'identity-obj-proxy',
  18. '\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.js',
  19. },
  20. }