Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'ts-jest',\n '^.+\\\\.jsx?

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'babel-jest'\n },\n\n // Coverage configuration\n collectCoverageFrom: [\n 'src/**/*.{js,jsx,ts,tsx}',\n '!src/**/*.d.ts',\n '!src/**/*.stories.{js,jsx,ts,tsx}',\n '!src/**/__tests__/**'\n ],\n\n // Coverage thresholds\n coverageThreshold: {\n global: {\n branches: 80,\n functions: 80,\n lines: 80,\n statements: 80\n }\n },\n\n // Setup files\n setupFilesAfterEnv: ['\u003crootDir>/jest.setup.js'],\n\n // Module name mapper for imports\n moduleNameMapper: {\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1',\n '\\\\.(css|less|scss|sass)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'identity-obj-proxy',\n '\\\\.(jpg|jpeg|png|gif|svg)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/__mocks__/fileMock.js'\n },\n\n // Clear mocks between tests\n clearMocks: true,\n\n // Restore mocks between tests\n restoreMocks: true,\n\n // Verbose output\n verbose: true\n};\n```\n\n### TypeScript Configuration (jest.config.ts)\n\n```typescript\nimport type { Config } from 'jest';\n\nconst config: Config = {\n preset: 'ts-jest',\n testEnvironment: 'node',\n roots: ['\u003crootDir>/src'],\n testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],\n transform: {\n '^.+\\\\.ts

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: ['ts-jest', {\n tsconfig: {\n esModuleInterop: true,\n allowSyntheticDefaultImports: true\n }\n }]\n },\n moduleNameMapper: {\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1'\n },\n collectCoverageFrom: [\n 'src/**/*.ts',\n '!src/**/*.d.ts',\n '!src/**/__tests__/**'\n ],\n coverageThreshold: {\n global: {\n branches: 80,\n functions: 80,\n lines: 80,\n statements: 80\n }\n }\n};\n\nexport default config;\n```\n\n### Package.json Configuration\n\n```json\n{\n \"scripts\": {\n \"test\": \"jest\",\n \"test:watch\": \"jest --watch\",\n \"test:coverage\": \"jest --coverage\",\n \"test:ci\": \"jest --ci --coverage --maxWorkers=2\"\n },\n \"jest\": {\n \"preset\": \"ts-jest\",\n \"testEnvironment\": \"node\"\n }\n}\n```\n\n## Setup Files\n\n### jest.setup.js\n\n```javascript\n// Global test setup\nimport '@testing-library/jest-dom';\n\n// Set up global test timeout\njest.setTimeout(10000);\n\n// Mock environment variables\nprocess.env.NODE_ENV = 'test';\nprocess.env.API_URL = 'http://localhost:3000';\n\n// Global before/after hooks\nbeforeAll(() => {\n // Setup code that runs once before all tests\n console.log('Starting test suite');\n});\n\nafterAll(() => {\n // Cleanup code that runs once after all tests\n console.log('Test suite completed');\n});\n\n// Mock console methods to reduce noise\nglobal.console = {\n ...console,\n error: jest.fn(),\n warning: jest.fn()\n};\n\n// Custom matchers\nexpect.extend({\n toBeWithinRange(received, floor, ceiling) {\n const pass = received >= floor && received \u003c= ceiling;\n if (pass) {\n return {\n message: () =>\n `expected ${received} not to be within range ${floor} - ${ceiling}`,\n pass: true\n };\n } else {\n return {\n message: () =>\n `expected ${received} to be within range ${floor} - ${ceiling}`,\n pass: false\n };\n }\n }\n});\n```\n\n### Setup for React Testing\n\n```javascript\nimport '@testing-library/jest-dom';\nimport { configure } from '@testing-library/react';\n\n// Configure testing library\nconfigure({ testIdAttribute: 'data-testid' });\n\n// Mock window.matchMedia\nObject.defineProperty(window, 'matchMedia', {\n writable: true,\n value: jest.fn().mockImplementation(query => ({\n matches: false,\n media: query,\n onchange: null,\n addListener: jest.fn(),\n removeListener: jest.fn(),\n addEventListener: jest.fn(),\n removeEventListener: jest.fn(),\n dispatchEvent: jest.fn()\n }))\n});\n\n// Mock IntersectionObserver\nglobal.IntersectionObserver = class IntersectionObserver {\n constructor() {}\n disconnect() {}\n observe() {}\n takeRecords() {\n return [];\n }\n unobserve() {}\n};\n```\n\n## Module Resolution\n\n### Path Mapping\n\n```javascript\n// jest.config.js\nmodule.exports = {\n moduleNameMapper: {\n // Alias mapping\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1',\n '^@components/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/components/$1',\n '^@utils/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/utils/$1',\n '^@hooks/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/hooks/$1',\n '^@services/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/services/$1',\n\n // Style mocks\n '\\\\.(css|less|scss|sass)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'identity-obj-proxy',\n\n // Asset mocks\n '\\\\.(jpg|jpeg|png|gif|svg)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/__mocks__/fileMock.js',\n '\\\\.(woff|woff2|eot|ttf|otf)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/__mocks__/fileMock.js'\n },\n\n // Module directories\n modulePaths: ['\u003crootDir>/src'],\n\n // Module paths to ignore\n modulePathIgnorePatterns: [\n '\u003crootDir>/dist/',\n '\u003crootDir>/build/',\n '\u003crootDir>/coverage/'\n ]\n};\n```\n\n### File Mocks\n\n```javascript\n// __mocks__/fileMock.js\nmodule.exports = 'test-file-stub';\n```\n\n```javascript\n// __mocks__/styleMock.js\nmodule.exports = {};\n```\n\n## Multi-Project Configuration\n\n### Monorepo Setup\n\n```javascript\n// jest.config.js\nmodule.exports = {\n projects: [\n {\n displayName: 'client',\n testEnvironment: 'jsdom',\n testMatch: ['\u003crootDir>/packages/client/**/*.test.{js,jsx,ts,tsx}'],\n setupFilesAfterEnv: ['\u003crootDir>/packages/client/jest.setup.js']\n },\n {\n displayName: 'server',\n testEnvironment: 'node',\n testMatch: ['\u003crootDir>/packages/server/**/*.test.{js,ts}'],\n setupFilesAfterEnv: ['\u003crootDir>/packages/server/jest.setup.js']\n },\n {\n displayName: 'shared',\n testEnvironment: 'node',\n testMatch: ['\u003crootDir>/packages/shared/**/*.test.{js,ts}']\n }\n ],\n coverageDirectory: '\u003crootDir>/coverage',\n collectCoverageFrom: [\n 'packages/*/src/**/*.{js,jsx,ts,tsx}',\n '!**/*.d.ts',\n '!**/node_modules/**'\n ]\n};\n```\n\n### Project-Specific Configuration\n\n```javascript\n// packages/client/jest.config.js\nmodule.exports = {\n displayName: 'client',\n preset: '../../jest.preset.js',\n testEnvironment: 'jsdom',\n transform: {\n '^.+\\\\.[tj]sx?

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: ['babel-jest', { presets: ['@babel/preset-react'] }]\n },\n moduleNameMapper: {\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1'\n }\n};\n```\n\n## Environment Configuration\n\n### Custom Test Environment\n\n```javascript\n// custom-environment.js\nconst NodeEnvironment = require('jest-environment-node').default;\n\nclass CustomEnvironment extends NodeEnvironment {\n constructor(config, context) {\n super(config, context);\n this.testPath = context.testPath;\n }\n\n async setup() {\n await super.setup();\n // Custom setup logic\n this.global.testEnvironmentSetup = true;\n }\n\n async teardown() {\n // Custom teardown logic\n delete this.global.testEnvironmentSetup;\n await super.teardown();\n }\n\n getVmContext() {\n return super.getVmContext();\n }\n}\n\nmodule.exports = CustomEnvironment;\n```\n\n```javascript\n// jest.config.js\nmodule.exports = {\n testEnvironment: './custom-environment.js'\n};\n```\n\n## Transform Configuration\n\n### Babel Transform\n\n```javascript\n// babel.config.js\nmodule.exports = {\n presets: [\n ['@babel/preset-env', { targets: { node: 'current' } }],\n '@babel/preset-typescript',\n '@babel/preset-react'\n ],\n plugins: [\n '@babel/plugin-proposal-class-properties',\n '@babel/plugin-transform-runtime'\n ]\n};\n```\n\n### Custom Transformer\n\n```javascript\n// custom-transformer.js\nconst { createTransformer } = require('babel-jest');\n\nmodule.exports = createTransformer({\n presets: [\n ['@babel/preset-env', { targets: { node: 'current' } }],\n '@babel/preset-typescript'\n ],\n plugins: ['babel-plugin-transform-import-meta']\n});\n```\n\n## Best Practices\n\n1. **Use TypeScript configuration files for type safety** - Leverage TypeScript config files to catch configuration errors at compile time\n2. **Organize tests in `__tests__` directories** - Keep tests close to source files for better discoverability\n3. **Set appropriate coverage thresholds** - Define realistic coverage goals that balance thoroughness with maintainability\n4. **Use setup files for global configuration** - Centralize common setup logic to avoid repetition across test files\n5. **Configure module name mappers for cleaner imports** - Use path aliases to make test imports more readable and maintainable\n6. **Separate environment-specific configurations** - Use different configs for Node vs browser environments\n7. **Clear mocks between tests** - Prevent test pollution by resetting mocks automatically\n8. **Use projects for monorepo setups** - Leverage multi-project configuration for better organization\n9. **Configure appropriate timeouts** - Set realistic timeouts for async operations to prevent false failures\n10. **Use verbose output during development** - Enable detailed logging to aid in debugging test failures\n\n## Common Pitfalls\n\n1. **Forgetting to install required dependencies** - Missing @types/jest or testing libraries causes cryptic errors\n2. **Incorrect module resolution paths** - Misconfigured moduleNameMapper leads to module not found errors\n3. **Not clearing mocks between tests** - Shared mock state causes flaky tests and false positives\n4. **Overly strict coverage thresholds** - Unrealistic coverage goals discourage testing and slow development\n5. **Missing transform configuration** - Files not being transformed leads to syntax errors in tests\n6. **Conflicting global and local configurations** - Package.json config overrides jest.config.js unexpectedly\n7. **Not configuring test environment correctly** - Using wrong environment (node vs jsdom) causes undefined errors\n8. **Ignoring setupFilesAfterEnv** - Missing global setup causes repetitive boilerplate in every test file\n9. **Not handling CSS/asset imports** - Unmocked style imports break tests in Node environment\n10. **Incorrect testMatch patterns** - Tests not being discovered due to pattern mismatches\n\n## When to Use This Skill\n\n- Setting up Jest in a new project from scratch\n- Migrating from another testing framework to Jest\n- Configuring Jest for TypeScript projects\n- Setting up testing infrastructure for monorepos\n- Optimizing Jest configuration for CI/CD pipelines\n- Debugging module resolution issues in tests\n- Configuring custom test environments\n- Setting up path aliases for cleaner imports\n- Implementing custom transformers for special file types\n- Establishing coverage requirements for your team\n---","attachment_filenames":[],"attachments":[],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Jest Configuration","type":"text"}]},{"type":"paragraph","content":[{"text":"Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Installation and Setup","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Basic Installation","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# npm\nnpm install --save-dev jest\n\n# yarn\nyarn add --dev jest\n\n# pnpm\npnpm add -D jest","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"TypeScript Support","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"npm install --save-dev @types/jest ts-jest","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"React Testing Libraries","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"npm install --save-dev @testing-library/react @testing-library/jest-dom","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Configuration Files","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"jest.config.js (Recommended)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"/** @type {import('jest').Config} */\nmodule.exports = {\n // Test environment\n testEnvironment: 'node', // or 'jsdom' for browser-like environment\n\n // Root directory for tests\n roots: ['\u003crootDir>/src'],\n\n // File extensions to consider\n moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],\n\n // Test match patterns\n testMatch: [\n '**/__tests__/**/*.[jt]s?(x)',\n '**/?(*.)+(spec|test).[jt]s?(x)'\n ],\n\n // Transform files before testing\n transform: {\n '^.+\\\\.tsx?

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'ts-jest',\n '^.+\\\\.jsx?

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'babel-jest'\n },\n\n // Coverage configuration\n collectCoverageFrom: [\n 'src/**/*.{js,jsx,ts,tsx}',\n '!src/**/*.d.ts',\n '!src/**/*.stories.{js,jsx,ts,tsx}',\n '!src/**/__tests__/**'\n ],\n\n // Coverage thresholds\n coverageThreshold: {\n global: {\n branches: 80,\n functions: 80,\n lines: 80,\n statements: 80\n }\n },\n\n // Setup files\n setupFilesAfterEnv: ['\u003crootDir>/jest.setup.js'],\n\n // Module name mapper for imports\n moduleNameMapper: {\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1',\n '\\\\.(css|less|scss|sass)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'identity-obj-proxy',\n '\\\\.(jpg|jpeg|png|gif|svg)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/__mocks__/fileMock.js'\n },\n\n // Clear mocks between tests\n clearMocks: true,\n\n // Restore mocks between tests\n restoreMocks: true,\n\n // Verbose output\n verbose: true\n};","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"TypeScript Configuration (jest.config.ts)","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"typescript"},"content":[{"text":"import type { Config } from 'jest';\n\nconst config: Config = {\n preset: 'ts-jest',\n testEnvironment: 'node',\n roots: ['\u003crootDir>/src'],\n testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],\n transform: {\n '^.+\\\\.ts

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: ['ts-jest', {\n tsconfig: {\n esModuleInterop: true,\n allowSyntheticDefaultImports: true\n }\n }]\n },\n moduleNameMapper: {\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1'\n },\n collectCoverageFrom: [\n 'src/**/*.ts',\n '!src/**/*.d.ts',\n '!src/**/__tests__/**'\n ],\n coverageThreshold: {\n global: {\n branches: 80,\n functions: 80,\n lines: 80,\n statements: 80\n }\n }\n};\n\nexport default config;","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Package.json Configuration","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"scripts\": {\n \"test\": \"jest\",\n \"test:watch\": \"jest --watch\",\n \"test:coverage\": \"jest --coverage\",\n \"test:ci\": \"jest --ci --coverage --maxWorkers=2\"\n },\n \"jest\": {\n \"preset\": \"ts-jest\",\n \"testEnvironment\": \"node\"\n }\n}","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Setup Files","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"jest.setup.js","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// Global test setup\nimport '@testing-library/jest-dom';\n\n// Set up global test timeout\njest.setTimeout(10000);\n\n// Mock environment variables\nprocess.env.NODE_ENV = 'test';\nprocess.env.API_URL = 'http://localhost:3000';\n\n// Global before/after hooks\nbeforeAll(() => {\n // Setup code that runs once before all tests\n console.log('Starting test suite');\n});\n\nafterAll(() => {\n // Cleanup code that runs once after all tests\n console.log('Test suite completed');\n});\n\n// Mock console methods to reduce noise\nglobal.console = {\n ...console,\n error: jest.fn(),\n warning: jest.fn()\n};\n\n// Custom matchers\nexpect.extend({\n toBeWithinRange(received, floor, ceiling) {\n const pass = received >= floor && received \u003c= ceiling;\n if (pass) {\n return {\n message: () =>\n `expected ${received} not to be within range ${floor} - ${ceiling}`,\n pass: true\n };\n } else {\n return {\n message: () =>\n `expected ${received} to be within range ${floor} - ${ceiling}`,\n pass: false\n };\n }\n }\n});","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Setup for React Testing","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"import '@testing-library/jest-dom';\nimport { configure } from '@testing-library/react';\n\n// Configure testing library\nconfigure({ testIdAttribute: 'data-testid' });\n\n// Mock window.matchMedia\nObject.defineProperty(window, 'matchMedia', {\n writable: true,\n value: jest.fn().mockImplementation(query => ({\n matches: false,\n media: query,\n onchange: null,\n addListener: jest.fn(),\n removeListener: jest.fn(),\n addEventListener: jest.fn(),\n removeEventListener: jest.fn(),\n dispatchEvent: jest.fn()\n }))\n});\n\n// Mock IntersectionObserver\nglobal.IntersectionObserver = class IntersectionObserver {\n constructor() {}\n disconnect() {}\n observe() {}\n takeRecords() {\n return [];\n }\n unobserve() {}\n};","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Module Resolution","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Path Mapping","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// jest.config.js\nmodule.exports = {\n moduleNameMapper: {\n // Alias mapping\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1',\n '^@components/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/components/$1',\n '^@utils/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/utils/$1',\n '^@hooks/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/hooks/$1',\n '^@services/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/services/$1',\n\n // Style mocks\n '\\\\.(css|less|scss|sass)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: 'identity-obj-proxy',\n\n // Asset mocks\n '\\\\.(jpg|jpeg|png|gif|svg)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/__mocks__/fileMock.js',\n '\\\\.(woff|woff2|eot|ttf|otf)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/__mocks__/fileMock.js'\n },\n\n // Module directories\n modulePaths: ['\u003crootDir>/src'],\n\n // Module paths to ignore\n modulePathIgnorePatterns: [\n '\u003crootDir>/dist/',\n '\u003crootDir>/build/',\n '\u003crootDir>/coverage/'\n ]\n};","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"File Mocks","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// __mocks__/fileMock.js\nmodule.exports = 'test-file-stub';","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// __mocks__/styleMock.js\nmodule.exports = {};","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Multi-Project Configuration","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Monorepo Setup","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// jest.config.js\nmodule.exports = {\n projects: [\n {\n displayName: 'client',\n testEnvironment: 'jsdom',\n testMatch: ['\u003crootDir>/packages/client/**/*.test.{js,jsx,ts,tsx}'],\n setupFilesAfterEnv: ['\u003crootDir>/packages/client/jest.setup.js']\n },\n {\n displayName: 'server',\n testEnvironment: 'node',\n testMatch: ['\u003crootDir>/packages/server/**/*.test.{js,ts}'],\n setupFilesAfterEnv: ['\u003crootDir>/packages/server/jest.setup.js']\n },\n {\n displayName: 'shared',\n testEnvironment: 'node',\n testMatch: ['\u003crootDir>/packages/shared/**/*.test.{js,ts}']\n }\n ],\n coverageDirectory: '\u003crootDir>/coverage',\n collectCoverageFrom: [\n 'packages/*/src/**/*.{js,jsx,ts,tsx}',\n '!**/*.d.ts',\n '!**/node_modules/**'\n ]\n};","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Project-Specific Configuration","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// packages/client/jest.config.js\nmodule.exports = {\n displayName: 'client',\n preset: '../../jest.preset.js',\n testEnvironment: 'jsdom',\n transform: {\n '^.+\\\\.[tj]sx?

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: ['babel-jest', { presets: ['@babel/preset-react'] }]\n },\n moduleNameMapper: {\n '^@/(.*)

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…

: '\u003crootDir>/src/$1'\n }\n};","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Environment Configuration","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Custom Test Environment","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// custom-environment.js\nconst NodeEnvironment = require('jest-environment-node').default;\n\nclass CustomEnvironment extends NodeEnvironment {\n constructor(config, context) {\n super(config, context);\n this.testPath = context.testPath;\n }\n\n async setup() {\n await super.setup();\n // Custom setup logic\n this.global.testEnvironmentSetup = true;\n }\n\n async teardown() {\n // Custom teardown logic\n delete this.global.testEnvironmentSetup;\n await super.teardown();\n }\n\n getVmContext() {\n return super.getVmContext();\n }\n}\n\nmodule.exports = CustomEnvironment;","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// jest.config.js\nmodule.exports = {\n testEnvironment: './custom-environment.js'\n};","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Transform Configuration","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Babel Transform","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// babel.config.js\nmodule.exports = {\n presets: [\n ['@babel/preset-env', { targets: { node: 'current' } }],\n '@babel/preset-typescript',\n '@babel/preset-react'\n ],\n plugins: [\n '@babel/plugin-proposal-class-properties',\n '@babel/plugin-transform-runtime'\n ]\n};","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Custom Transformer","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"javascript"},"content":[{"text":"// custom-transformer.js\nconst { createTransformer } = require('babel-jest');\n\nmodule.exports = createTransformer({\n presets: [\n ['@babel/preset-env', { targets: { node: 'current' } }],\n '@babel/preset-typescript'\n ],\n plugins: ['babel-plugin-transform-import-meta']\n});","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Best Practices","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use TypeScript configuration files for type safety","type":"text","marks":[{"type":"strong"}]},{"text":" - Leverage TypeScript config files to catch configuration errors at compile time","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Organize tests in ","type":"text","marks":[{"type":"strong"}]},{"text":"__tests__","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" directories","type":"text","marks":[{"type":"strong"}]},{"text":" - Keep tests close to source files for better discoverability","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Set appropriate coverage thresholds","type":"text","marks":[{"type":"strong"}]},{"text":" - Define realistic coverage goals that balance thoroughness with maintainability","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use setup files for global configuration","type":"text","marks":[{"type":"strong"}]},{"text":" - Centralize common setup logic to avoid repetition across test files","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Configure module name mappers for cleaner imports","type":"text","marks":[{"type":"strong"}]},{"text":" - Use path aliases to make test imports more readable and maintainable","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Separate environment-specific configurations","type":"text","marks":[{"type":"strong"}]},{"text":" - Use different configs for Node vs browser environments","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Clear mocks between tests","type":"text","marks":[{"type":"strong"}]},{"text":" - Prevent test pollution by resetting mocks automatically","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use projects for monorepo setups","type":"text","marks":[{"type":"strong"}]},{"text":" - Leverage multi-project configuration for better organization","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Configure appropriate timeouts","type":"text","marks":[{"type":"strong"}]},{"text":" - Set realistic timeouts for async operations to prevent false failures","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use verbose output during development","type":"text","marks":[{"type":"strong"}]},{"text":" - Enable detailed logging to aid in debugging test failures","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Common Pitfalls","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Forgetting to install required dependencies","type":"text","marks":[{"type":"strong"}]},{"text":" - Missing @types/jest or testing libraries causes cryptic errors","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Incorrect module resolution paths","type":"text","marks":[{"type":"strong"}]},{"text":" - Misconfigured moduleNameMapper leads to module not found errors","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Not clearing mocks between tests","type":"text","marks":[{"type":"strong"}]},{"text":" - Shared mock state causes flaky tests and false positives","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Overly strict coverage thresholds","type":"text","marks":[{"type":"strong"}]},{"text":" - Unrealistic coverage goals discourage testing and slow development","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Missing transform configuration","type":"text","marks":[{"type":"strong"}]},{"text":" - Files not being transformed leads to syntax errors in tests","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Conflicting global and local configurations","type":"text","marks":[{"type":"strong"}]},{"text":" - Package.json config overrides jest.config.js unexpectedly","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Not configuring test environment correctly","type":"text","marks":[{"type":"strong"}]},{"text":" - Using wrong environment (node vs jsdom) causes undefined errors","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ignoring setupFilesAfterEnv","type":"text","marks":[{"type":"strong"}]},{"text":" - Missing global setup causes repetitive boilerplate in every test file","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Not handling CSS/asset imports","type":"text","marks":[{"type":"strong"}]},{"text":" - Unmocked style imports break tests in Node environment","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Incorrect testMatch patterns","type":"text","marks":[{"type":"strong"}]},{"text":" - Tests not being discovered due to pattern mismatches","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Use This Skill","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Setting up Jest in a new project from scratch","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Migrating from another testing framework to Jest","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Configuring Jest for TypeScript projects","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Setting up testing infrastructure for monorepos","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Optimizing Jest configuration for CI/CD pipelines","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Debugging module resolution issues in tests","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Configuring custom test environments","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Setting up path aliases for cleaner imports","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Implementing custom transformers for special file types","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Establishing coverage requirements for your team","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"jest-configuration","author":"@skillopedia","source":{"stars":163,"repo_name":"han","origin_url":"https://github.com/thebushidocollective/han/blob/HEAD/plugins/tools/jest/skills/jest-configuration/SKILL.md","repo_owner":"thebushidocollective","body_sha256":"80b07a7b859cbc958b0800882eec248b826540b095bb4ae5282cc8ecfa0bd758","cluster_key":"754cf5f5c356c077060b9aad2853758fd1a72363acefbb91a10dc8b2e454f8ca","clean_bundle":{"format":"clean-skill-bundle-v1","source":"thebushidocollective/han/plugins/tools/jest/skills/jest-configuration/SKILL.md","bundle_sha256":"fb4dd396c0801d94162d094d81ad5956c1d7d18d7057e3e40abce9bb3e8cc1e9","attachment_count":0,"text_attachments":0,"binary_attachments":0},"cluster_size":1,"skill_md_path":"plugins/tools/jest/skills/jest-configuration/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"testing-qa","category_label":"Testing"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"testing-qa","import_tag":"clean-skills-v1","description":"Use when jest configuration, setup files, module resolution, and project organization for optimal testing environments.","allowed-tools":["Read","Write","Edit","Bash","Glob","Grep"],"user-invocable":false}},"renderedAt":1782980982895}

Jest Configuration Master Jest configuration, setup files, module resolution, and project organization for optimal testing environments. This skill covers all aspects of configuring Jest for modern JavaScript and TypeScript projects, from basic setup to advanced multi-project configurations. Installation and Setup Basic Installation TypeScript Support React Testing Libraries Configuration Files jest.config.js (Recommended) TypeScript Configuration (jest.config.ts) Package.json Configuration Setup Files jest.setup.js Setup for React Testing Module Resolution Path Mapping File Mocks Multi-Proje…