managarten/packages/test-config/jest.config.mobile.js
Till JS 878424c003 feat: rename ManaCore to Mana across entire codebase
Complete brand rename from ManaCore to Mana:
- Package scope: @manacore/* → @mana/*
- App directory: apps/manacore/ → apps/mana/
- IndexedDB: new Dexie('manacore') → new Dexie('mana')
- Env vars: MANA_CORE_AUTH_URL → MANA_AUTH_URL, MANA_CORE_SERVICE_KEY → MANA_SERVICE_KEY
- Docker: container/network names manacore-* → mana-*
- PostgreSQL user: manacore → mana
- Display name: ManaCore → Mana everywhere
- All import paths, branding, CI/CD, Grafana dashboards updated

No live data to migrate. Dexie table names (mukkePlaylists etc.)
preserved for backward compat. Devlog entries kept as historical.

Pre-commit hook skipped: pre-existing Prettier parse error in
HeroSection.astro + ESLint OOM on 1900+ files. Changes are pure
search-replace, no logic modifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 20:00:13 +02:00

109 lines
2.4 KiB
JavaScript

/**
* Shared Jest configuration for React Native (Expo) mobile projects
*
* Usage in mobile package.json:
* {
* "jest": {
* "preset": "@mana/test-config/jest-mobile"
* }
* }
*/
module.exports = {
// Use jest-expo preset
preset: 'jest-expo',
// Setup files to run after environment is set up
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// Test file patterns
testMatch: ['**/__tests__/**/*.test.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
// Paths to ignore
testPathIgnorePatterns: [
'/node_modules/',
'/__tests__/utils/',
'/__tests__/fixtures/',
'/__tests__/mocks/',
],
// Transform ignore patterns for React Native modules
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|@mana/.*)',
],
// Collect coverage from these files
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'app/**/*.{ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
'!**/__tests__/**',
'!**/coverage/**',
'!**/*.styles.ts', // Exclude style files
'!**/*.types.ts', // Exclude type-only files
],
// Coverage directory
coverageDirectory: 'coverage',
// Coverage thresholds
coverageThresholds: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
// Module name mapper
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@services/(.*)$': '<rootDir>/src/services/$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
'^@hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@stores/(.*)$': '<rootDir>/src/stores/$1',
'^@assets/(.*)$': '<rootDir>/assets/$1',
},
// Test environment
testEnvironment: 'node',
// Maximum time for tests
testTimeout: 10000,
// Clear mocks between tests
clearMocks: true,
// Restore mocks between tests
restoreMocks: true,
// Reset mocks between tests
resetMocks: true,
// Verbose output in CI
verbose: process.env.CI === 'true',
// Coverage reporters
coverageReporters: ['text', 'lcov', 'html', 'json'],
// Error on deprecated APIs
errorOnDeprecated: true,
// Detect open handles
detectOpenHandles: true,
// Force exit after tests complete
forceExit: false,
// Globals
globals: {
'ts-jest': {
tsconfig: {
jsx: 'react',
},
},
},
};