const path = require('path'); const srcPath = 'lib/assets/javascripts/'; const testPath = 'lib/assets/test/spec/new-dashboard'; const rootDir = path.resolve(__dirname, '../../../../../../'); module.exports = { rootDir, roots: [ `/${testPath}/unit/specs` ], moduleFileExtensions: [ 'js', 'json', 'vue' ], modulePaths: [ '/vendor/assets/javascripts' ], moduleNameMapper: { '^new-dashboard/core/dialog-actions$': `/${testPath}/unit/specs/components/__mocks__/dialog-actions.js`, '^new-dashboard/(.*)$': `/${srcPath}/new-dashboard/$1`, '^dashboard/(.*)$': `/${srcPath}/dashboard/$1`, '^builder/(.*)$': `/${srcPath}/builder/$1`, '^backbone/core-view$': `/${srcPath}/vendor/backbone/core-view.js`, '^mousewheel$': `/node_modules/internal-carto.js/vendor/mousewheel`, '^mwheelIntent$': `/node_modules/internal-carto.js/vendor/mwheelIntent`, '^html-css-sanitizer$': `/node_modules/internal-carto.js/vendor/html-css-sanitizer-bundle`, '^cdb$': `/node_modules/internal-carto.js/src/cdb`, '^cdb.log$': `/node_modules/internal-carto.js/src/cdb.log`, '^cdb.core.Profiler$': `/node_modules/internal-carto.js/src/core/profiler`, '^cdb.core.util$': `/node_modules/internal-carto.js/src/core/util`, '^cdb.templates$': `/node_modules/internal-carto.js/src/cdb.templates`, '^cdb.config$': `/node_modules/internal-carto.js/src/cdb.config`, '^carto-node$': `/lib/assets/javascripts/carto-node`, '^tipsy$': `/vendor/assets/javascripts/jquery.tipsy.js` }, transform: { '^.+\\.js$': '/node_modules/babel-jest', '^.+\\.tpl$': `/${testPath}/unit/utils/tplLoader.js`, '.*\\.(vue)$': '/node_modules/vue-jest', '^.+\\.svg$': `/${testPath}/unit/utils/svg-transform.js` }, transformIgnorePatterns: [ 'node_modules/(?!(internal-carto.js)/)' ], silent: true, snapshotSerializers: ['/node_modules/jest-serializer-vue'], setupFiles: [`/${testPath}/unit/setup`], coverageDirectory: `/${testPath}/coverage`, collectCoverageFrom: [ `${srcPath}/new-dashboard/**/*.{js,vue}` ], globals: { 'vue-jest': { babelConfig: { configFile: path.join(rootDir, 'babel.config.json') } } } };