2019-10-14 18:48:46 +00:00
|
|
|
process.env.VUE_CLI_BABEL_TARGET_NODE = true;
|
|
|
|
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true;
|
|
|
|
|
|
|
|
module.exports = {
|
2019-11-29 12:12:35 +00:00
|
|
|
moduleDirectories: ['node_modules', 'app/javascript'],
|
|
|
|
moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'ts', 'tsx'],
|
2019-10-14 18:48:46 +00:00
|
|
|
automock: false,
|
|
|
|
resetMocks: true,
|
|
|
|
transform: {
|
|
|
|
'^.+\\.vue$': 'vue-jest',
|
2019-11-29 12:12:35 +00:00
|
|
|
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
|
2019-10-14 18:48:46 +00:00
|
|
|
'jest-transform-stub',
|
2019-11-29 12:12:35 +00:00
|
|
|
'^.+\\.(js|jsx)?$': 'babel-jest',
|
2019-10-14 18:48:46 +00:00
|
|
|
},
|
|
|
|
cacheDirectory: '<rootDir>/.jest-cache',
|
|
|
|
collectCoverage: false,
|
|
|
|
coverageDirectory: 'buildreports',
|
|
|
|
collectCoverageFrom: ['**/app/javascript/**/*.js'],
|
|
|
|
reporters: ['default'],
|
|
|
|
// setupTestFrameworkScriptFile: './tests/setup.ts',
|
|
|
|
transformIgnorePatterns: ['node_modules/*'],
|
|
|
|
moduleNameMapper: {
|
|
|
|
'^@/(.*)$': '<rootDir>/app/javascript/$1',
|
2020-02-16 11:50:38 +00:00
|
|
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
|
|
|
'<rootDir>/__mocks__/fileMock.js',
|
2019-10-14 18:48:46 +00:00
|
|
|
},
|
|
|
|
roots: ['<rootDir>/app/javascript'],
|
|
|
|
snapshotSerializers: ['jest-serializer-vue'],
|
|
|
|
testMatch: [
|
|
|
|
'**/app/javascript/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)',
|
|
|
|
],
|
|
|
|
testURL: 'http://localhost/',
|
2021-02-11 06:40:08 +00:00
|
|
|
globalSetup: './jest.setup.js',
|
2021-08-11 14:59:33 +00:00
|
|
|
testEnvironment: 'jsdom',
|
2019-10-14 18:48:46 +00:00
|
|
|
};
|