forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.front.js
44 lines (43 loc) · 1.89 KB
/
jest.config.front.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const jest = require('jest');
module.exports = {
collectCoverageFrom: [
'packages/strapi-plugin-content-type-builder/admin/src/**/**/*.js',
'packages/strapi-plugin-content-type-builder/admin/src/InjectedComponents/*.js',
'packages/strapi-plugin-content-type-builder/admin/src/InjectedComponents/tests/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/TableList/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/TableListRow/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/utils/*.js',
'!packages/strapi-plugin-*/admin/src/**/**/tests/*.test.{js,jsx}',
],
globals: {
__webpack_public_path__: 'http://localhost:4000',
strapi: {},
},
moduleDirectories: [
'node_modules',
'<rootDir>/packages/strapi-helper-plugin/node_modules',
'<rootDir>/packages/strapi-helper-plugin',
'<rootDir>/packages/strapi-helper-plugin/lib/src',
],
moduleNameMapper: {
'.*\\.(css|less|styl|scss|sass)$':
'<rootDir>/packages/strapi-helper-plugin/lib/internals/mocks/cssModule.js',
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/packages/strapi-helper-plugin/lib/internals/mocks/image.js',
},
rootDir: process.cwd(),
setupTestFrameworkScriptFile:
'<rootDir>/packages/strapi-helper-plugin/lib/internals/testing/test-bundler.js',
setupFiles: [
'<rootDir>/packages/strapi-helper-plugin/node_modules/raf/polyfill',
'<rootDir>/packages/strapi-helper-plugin/lib/internals/testing/enzyme-setup.js',
'<rootDir>/packages/strapi-helper-plugin/lib/internals/testing/strapi.js',
],
testRegex: 'tests/.*\\.test\\.js$',
transform: {
'^.+\\.js$': 'babel-jest',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/fileTransformer.js',
},
testURL: 'http://localhost:4000/admin',
};