Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
PROJECT_ROOT,
getModulePaths,
} = require('./utils/project.js');
function getCoveragePaths() {
const modulePaths = getModulePaths();
return modulePaths.map(p => {
// convert back to forward slashes here on Windows for Jest to be happy
return p.replace(/\\/g, '/') + '**/*.js';
});
}
const jestConfig = {
rootDir: PROJECT_ROOT,
moduleFileExtensions: ['js', 'html'],
testEnvironment: jestPreset.testEnvironment || 'jsdom',
transform: {
'^.+\\.(js|html|css)$': require.resolve('@lwc/jest-transformer')
},
transformIgnorePatterns: [
"/node_modules/(?!(.*@salesforce/sfdx-lwc-jest/src/lightning-stubs)/)"
],
resolver: path.resolve(__dirname, './resolver.js'),
testPathIgnorePatterns: [
'/node_modules/',
'/test/specs/',
],
collectCoverageFrom: getCoveragePaths(),
snapshotSerializers: [
require.resolve('@lwc/jest-serializer')
],
};