eletrotupi / tcc/ frontend/jest.config.js27bca510c14b3745f6fa52ae54fac66653498781
1.1 KB | 33 lines Raw
1
/** @type {import('jest').Config} */
2
module.exports = {
3
  // The runner Expo ships for this SDK. Android-only, like the app itself.
4
  preset: 'jest-expo/android',
5

6
  // The suite mirrors the source under its own `tests/` tree. Nothing under the
7
  // router's `app/` is ever matched, so expo-router cannot mistake a test for a
8
  // route. Pure tests carry the `.unit.test` suffix, mirroring the API.
9
  testMatch: [
10
    '<rootDir>/tests/**/*.test.ts',
11
    '<rootDir>/tests/**/*.test.tsx',
12
  ],
13

14
  // Source is imported through the same `@/` alias the app uses.
15
  moduleNameMapper: {
16
    '^@/(.*)$': '<rootDir>/$1',
17
  },
18

19
  // One place shades the native/Expo boundary for the whole suite, so no
20
  // individual test re-stubs the device.
21
  setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
22

23
  // Report-only, matching the API: the unit-versus-render ratio is visible but
24
  // never gates a build.
25
  collectCoverageFrom: [
26
    'lib/**/*.{ts,tsx}',
27
    'hooks/**/*.{ts,tsx}',
28
    'stores/**/*.{ts,tsx}',
29
    'constants/**/*.{ts,tsx}',
30
    'components/**/*.{ts,tsx}',
31
  ],
32
  coverageReporters: ['text', 'html'],
33
};