How to use the jest-expo/jest-preset.setupFiles function in jest-expo

To help you get started, we’ve selected a few jest-expo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dooboolab / hackatalk-mobile / jest.config.js View on Github external
jsx: 'react',
      },
      diagnostics: false,
    },
  },
  modulePathIgnorePatterns: [
    '/build/',
    '/node_modules/',
    '/.history/',
  ],
  moduleNameMapper: {
    '\\.svg': '/__mocks__/svgMock.js',
    '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'babel-jest',
  },
  setupFiles: [
    ...expoPreset.setupFiles,
    ...jestPreset.setupFiles,
    '/test/jestSetup.ts',
  ],
  /* eslint-disable */
  transformIgnorePatterns: [
    'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules-*|sentry-expo|native-base|@dooboo-ui)',
  ],
  /* eslint-enable */
  setupFilesAfterEnv: ['./test/setupTest.js'],
};
github jeanverster / react-native-styled-toast / jest.config.js View on Github external
const expoPreset = require('jest-expo/jest-preset')

module.exports = Object.assign(expoPreset, jestPreset, {
  setupFiles: [...expoPreset.setupFiles, './setup-tests.js'],
  transformIgnorePatterns: [
    'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|sentry-expo|native-base)'
  ],
  moduleFileExtensions: ['js', 'ts', 'tsx'],
  coverageThreshold: {
    global: {
      lines: 75
    }
  },
  collectCoverageFrom: [
    'src/**/*.{js,jsx,ts,tsx}',
    '!src/utils/styled-components.ts',
    '!src/utils/suppress-rc-warnings.js',
    '!src/utils/mock-schema.ts',
    '!src/generated/graphql.tsx',
    '!src/aws-exports.js',

jest-expo

A Jest preset to painlessly test your Expo / React Native apps.

MIT
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis

Similar packages