Having trouble setting up jest projects. Project A has some additional configuration that it runs (setupJest, creates some custom matchers, etc) that project B does not have. When I run jest I get this error for every single test it tries to run:
Test suite failed to run
File not found: <rootDir>/src/tsconfig.spec.json (resolved as: repo\src\tsconfig.spec.json)
There is no src folder in the repo root, only inside the individual project folders. I'm also not referencing src\tsconfig.spec.json anywhere in my setups. So I'm a bit confused at this point as to what to try. I've tried putting rootDir on everything and spelling out the paths, but nothing seems to work. Any suggestions or ideas or help would be REALLY welcome.
For reference, repo is a folder on a windows drive that holds the repo. e.g. c:\companyName\productName\
This is my structure
repo
|- jest.config.js
|- projects
|- projectA
|- jest.config.js
|- tsconfig.spec.json
|- src
|- setupJest.js
|- projectB
|- jest.config.js
|- tsconfig.spec.json
root jest.config.js:
module.exports = {
preset: 'jest-preset-angular',
projects: [
'<rootDir>/projects/projectA/jest.config.js',
'<rootDir>/projects/projectB/jest.config.js'
]
reporters: ['jest-silent-reporter'],
};
projectA jest.config.js:
module.exports = {
globals: {
'ts-jest': {
tsConfig: 'tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
astTransformers: ['jest-preset-angular/InlineHtmlStripStylesTransformer'],
diagnostics: false,
},
},
setupFilesAfterEnv: ['src/setupJest.ts'],
};
projectB jest.config.js:
module.exports = {
globals: {
'ts-jest': {
tsConfig: 'tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
astTransformers: ['jest-preset-angular/InlineHtmlStripStylesTransformer'],
diagnostics: false,
},
},
};