aboutsummaryrefslogtreecommitdiffstats
path: root/config/jest.config.base.js
blob: f265c1cf1f2760600664cd92759784b9ce39c52f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { join } from 'path';

import { fileURLToDirname } from './utils.js';

const dirname = fileURLToDirname(import.meta.url);

/** @type {import('ts-jest').InitialOptionsTsJest} */
export default {
  preset: 'ts-jest/presets/default-esm',
  globals: {
    'ts-jest': {
      useESM: true,
    },
  },
  moduleNameMapper: {
    '@sophie/(.+)': join(dirname, '../packages/$1/src/index.ts'),
    '^(\\.{1,2}/.*)\\.js$': '$1',
  },
  resetMocks: true,
  restoreMocks: true,
  testEnvironment: 'node',
  testPathIgnorePatterns: [
    '/dist/',
    '/node_modules/',
  ],
};