jest.config.cjs 580 B

123456789101112131415161718
  1. const { compilerOptions } = require('./tsconfig.json');
  2. const { pathsToModuleNameMapper } = require("ts-jest");
  3. /** @type {import('ts-jest').JestConfigWithTsJest} */
  4. module.exports = {
  5. preset: 'ts-jest',
  6. testEnvironment: 'node',
  7. roots: ['<rootDir>'],
  8. modulePaths: [compilerOptions.baseUrl],
  9. moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths),
  10. "transform": {
  11. "(.*)/node_modules/nanoid/.+\\.(j|t)sx?$": "ts-jest"
  12. },
  13. "transformIgnorePatterns": [
  14. "node_modules/(?!nanoid/.*)"
  15. ],
  16. "testRegex": "(/__tests__/.*\.(test|spec))\\.(jsx?|tsx?)$",
  17. };