react-code-dataset / tsdx /src /createJestConfig.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
873 Bytes
import { Config } from '@jest/types';
export type JestConfigOptions = Partial<Config.InitialOptions>;
export function createJestConfig(
_: (relativePath: string) => void,
rootDir: string
): JestConfigOptions {
const config: JestConfigOptions = {
transform: {
'.(ts|tsx)$': require.resolve('ts-jest/dist'),
'.(js|jsx)$': require.resolve('babel-jest'), // jest's default
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverageFrom: ['src/**/*.{ts,tsx,js,jsx}'],
testMatch: ['<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}'],
testURL: 'http://localhost',
rootDir,
watchPlugins: [
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],
};
return config;
}