I am trying to configure jest for the monorepo structured as follows:
The idea is to run the tests across the applications from root and not install and configure in every application that might come up in future such as cra, gatsby, next-app etc.,
Configurations for jest are as follows:
module.exports = {
projects: ['./others/local-jest.config.js'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
'.+\\.(css|scss)$': 'identity-obj-proxy'
},
moduleDirectories: ['node_modules']
};
When the jest.config.js file is located in cra, everything went perfect and identity-obj-proxy worked fine. But when I moved it into root with all the dependencies installed, jest is throwing errors with css files imported
I have been trying for the lead but none so far!

