How to use jest-expo - 10 common examples

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 byCedric / use-expo / packages / screen-orientation / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
github byCedric / use-expo / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'/packages/**/*.test.ts',
	],
	modulePathIgnorePatterns: [
		'/example',
	],
};
github byCedric / use-expo / packages / font / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
github byCedric / use-expo / packages / permissions / jest.config.js View on Github external
/* eslint-disable @typescript-eslint/no-var-requires */
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
	...jestExpoPreset,
	clearMocks: true,
	transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
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 byCedric / use-expo / packages / sensors / jest.config.js View on Github external
const jestExpoPreset = require('jest-expo/jest-preset');
const { jsWithBabel: tsJestPreset } = require('ts-jest/presets');

module.exports = {
    ...jestExpoPreset,
    clearMocks: true,
    transform: {
		...tsJestPreset.transform,
		...jestExpoPreset.transform,
	},
	testMatch: [
		'**/*.test.ts',
	],
};
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',
github expo / expo / packages / jest-expo-enzyme / jest-preset.js View on Github external
const { withWatchPlugins } = require('jest-expo/config');
const { withEnzyme } = require('.');

module.exports = withWatchPlugins({
  projects: [
    withEnzyme(require('jest-expo/ios/jest-preset')),
    withEnzyme(require('jest-expo/android/jest-preset')),
    withEnzyme(require('jest-expo/web/jest-preset')),
  ],
});
github expo / expo / packages / expo-module-scripts / jest-preset.js View on Github external
const { withWatchPlugins } = require('jest-expo/config');
const createJestPreset = require('./createJestPreset');
module.exports = withWatchPlugins({
  projects: [
    createJestPreset(require('jest-expo/ios/jest-preset')),
    createJestPreset(require('jest-expo/android/jest-preset')),
    createJestPreset(require('jest-expo/web/jest-preset')),
    createJestPreset(require('jest-expo/node/jest-preset')),
  ],
});

jest-expo

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

MIT
Latest version published 1 month ago

Package Health Score

83 / 100
Full package analysis

Similar packages