import type { Config } from 'jest' const config: Config = { // The directory where Jest should output its coverage files coverageDirectory: 'coverage', // Indicates which provider should be used to instrument code for coverage coverageProvider: 'v8', // A set of global variables that need to be available in all test environments globals: { 'ts-jest': { tsconfig: '/tsconfig.json', isolatedModules: true, }, }, // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module moduleNameMapper: { '^lodash-es$': 'lodash', '^@logicflow/core$': '/packages/core/src/index.ts', '^@logicflow/extension$': '/packages/extension/src/index.ts', }, // A list of paths to modules that run some code to configure or set up the testing framework before each test setupFilesAfterEnv: ['/jest.setup.ts'], // The test environment that will be used for testing testEnvironment: 'jest-environment-jsdom', testEnvironmentOptions: { customExportConditions: ['node', 'node-addons'], }, // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped testPathIgnorePatterns: [ '/node_modules/', '/es/', '/lib/', '/examples/vue3-app/', ], // A map from regular expressions to paths to transformers transform: { '^.+\\.tsx?$': 'ts-jest', '^.+\\.jsx?$': 'babel-jest', }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation transformIgnorePatterns: ['/node_modules/'], } export default config