/
mustreets
/
TestApp
Обзор
Документация
Войти
/
mustreets
/
TestApp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
1
CI/CD
Аналитика
Безопасность
master
jest.config.js
29 строк
710 B
Slava
Remove Crashlytics integration from the beta lane in Fastfile
07 июн 2026, 20:06
07 июн 2026, 20:06
f21773c
Код
Авторство
О чём код?
const path = require('path'); const aliases = require('./aliases'); /** @param {Record<string, string>} aliasObj */ const generateJestMapper = (aliasObj) => { const mapper = {}; Object.keys(aliasObj).forEach((key) => { const cleanPath = aliasObj[key].replace(/^\.\//, ''); mapper[`^${key}/(.*)$`] = `<rootDir>/${cleanPath}/$1`; mapper[`^${key}$`] = `<rootDir>/${cleanPath}`; }); return mapper; }; module.exports = { preset: 'react-native', moduleFileExtensions: [ 'ts', 'tsx', 'js', 'jsx', 'json', 'node', ], moduleNameMapper: { '^react-native($|/.*)': `${path.dirname(require.resolve('react-native'))}/$1`, ...generateJestMapper(aliases), }, };