@@ -2,14 +2,6 @@ import type { Config } from '@jest/types'
22
33const packages : string [ ] = [ 'material-color' , 'material-colorful' ]
44
5- const testMatchesLint : string [ ] = [ ]
6-
7- packages . forEach ( pkg => {
8- testMatchesLint . push ( ...[
9- '<rootDir>/' + pkg + '/src/**/*.(js|ts|tsx)' ,
10- '<rootDir>/' + pkg + '/tests/**/*.(test|spec|d).(js|ts|tsx)' ,
11- ] )
12- } )
135const base : Partial < Config . InitialOptions > = {
146 /*transformIgnorePatterns: [
157 'node_modules/?!(@ui-schema)',
@@ -18,8 +10,8 @@ const base: Partial<Config.InitialOptions> = {
1810 '^.+\\.tsx?$': 'ts-jest',
1911 },*/
2012 moduleNameMapper : {
21- '^@ui-schema/material-color(.*)$' : '<rootDir>/material-color/src$1' ,
22- '^@ui-schema/material-colorful(.*)$' : '<rootDir>/material-colorful/src$1' ,
13+ '^@ui-schema/material-color(.*)$' : '<rootDir>/packages/ material-color/src$1' ,
14+ '^@ui-schema/material-colorful(.*)$' : '<rootDir>/packages/ material-colorful/src$1' ,
2315 } ,
2416 moduleFileExtensions : [
2517 'ts' ,
@@ -46,26 +38,20 @@ const config: Config.InitialOptions = {
4638 ...packages . map ( pkg => ( {
4739 displayName : 'test-' + pkg ,
4840 ...base ,
49- moduleDirectories : [ 'node_modules' , '<rootDir>/' + pkg + '/node_modules' ] ,
50- //moduleDirectories: ['node_modules', '<rootDir>/ui-schema/node_modules', '<rootDir>/ds-material/node_modules'],
41+ moduleDirectories : [ 'node_modules' , '<rootDir>/packages/ ' + pkg + '/node_modules' ] ,
42+ //moduleDirectories: ['node_modules', '<rootDir>/packages/ ui-schema/node_modules', '<rootDir>/packages /ds-material/node_modules'],
5143 // todo: check why `transformIgnorePatterns`, combined with multi-projects/lerna 0.5.3 upgrade, throws `TypeError: /node_modules/jest-runner-eslint/build/runner/index.js: node_modules/@ampproject/remapping/dist/remapping.umd.js: _remapping(...) is not a function`
5244 /*transformIgnorePatterns: [
5345 'node_modules/?!(@ui-schema)',
5446 ],*/
5547 //testEnvironmentOptions: {},
5648 testMatch : [
57- '<rootDir>/' + pkg + '/src/**/*.(test|spec).(js|ts|tsx)' ,
58- '<rootDir>/' + pkg + '/tests/**/*.(test|spec).(js|ts|tsx)' ,
49+ '<rootDir>/packages/ ' + pkg + '/src/**/*.(test|spec).(js|ts|tsx)' ,
50+ '<rootDir>/packages/ ' + pkg + '/tests/**/*.(test|spec).(js|ts|tsx)' ,
5951 ] ,
6052 } ) ) ,
61- {
62- displayName : 'lint' ,
63- runner : 'jest-runner-eslint' ,
64- ...base ,
65- testMatch : testMatchesLint ,
66- } ,
6753 ] ,
68- coverageDirectory : '<rootDir>/../ coverage' ,
54+ coverageDirectory : '<rootDir>/coverage' ,
6955}
7056
7157export default config
0 commit comments