tldraw/config/jest/node/jest-preset.js

37 lines
831 B
JavaScript
Raw Normal View History

2023-04-25 11:01:25 +00:00
module.exports = {
roots: ['<rootDir>/src'],
transform: {
'^.+\\.(tsx|jsx|ts|js|mjs)?$': [
'@swc/jest',
{
jsc: {
parser: {
syntax: 'typescript',
dynamicImport: true,
decorators: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
react: {
runtime: 'automatic',
},
},
},
},
],
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
modulePathIgnorePatterns: [
'<rootDir>/test/__fixtures__',
'<rootDir>/node_modules',
'<rootDir>/dist',
'<rootDir>/.tsbuild',
'<rootDir>/.tsbuild-dev',
'<rootDir>/.tsbuild-pub',
],
transformIgnorePatterns: ['node_modules/(?!(nanoid)/)'],
collectCoverageFrom: ['<rootDir>/src/**/*.{ts,tsx}'],
}