2019-01-15 18:53:27 -05:00
|
|
|
/**
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
* or more contributor license agreements. See the NOTICE file
|
|
|
|
* distributed with this work for additional information
|
|
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
|
|
* to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
2021-11-29 19:29:57 -05:00
|
|
|
|
2018-10-15 16:10:18 -04:00
|
|
|
module.exports = {
|
2022-02-07 12:11:48 -05:00
|
|
|
testRegex:
|
2022-04-27 05:44:13 -04:00
|
|
|
'\\/superset-frontend\\/(spec|src|plugins|packages|tools)\\/.*(_spec|\\.test)\\.[jt]sx?$',
|
2018-10-15 16:10:18 -04:00
|
|
|
moduleNameMapper: {
|
2021-08-25 02:10:46 -04:00
|
|
|
'\\.(css|less|geojson)$': '<rootDir>/spec/__mocks__/mockExportObject.js',
|
|
|
|
'\\.(gif|ttf|eot|png|jpg)$': '<rootDir>/spec/__mocks__/mockExportString.js',
|
2021-04-29 14:49:39 -04:00
|
|
|
'\\.svg$': '<rootDir>/spec/__mocks__/svgrMock.tsx',
|
2018-10-24 01:33:51 -04:00
|
|
|
'^src/(.*)$': '<rootDir>/src/$1',
|
2020-07-16 19:07:49 -04:00
|
|
|
'^spec/(.*)$': '<rootDir>/spec/$1',
|
2022-01-07 20:16:24 -05:00
|
|
|
// mapping plugins of superset-ui to souce code
|
|
|
|
'@superset-ui/(.*)$': '<rootDir>/node_modules/@superset-ui/$1/src',
|
2018-10-15 16:10:18 -04:00
|
|
|
},
|
2021-02-16 11:48:16 -05:00
|
|
|
testEnvironment: 'jsdom',
|
2022-02-14 03:12:43 -05:00
|
|
|
modulePathIgnorePatterns: ['<rootDir>/packages/generator-superset'],
|
2020-12-01 14:14:37 -05:00
|
|
|
setupFilesAfterEnv: ['<rootDir>/spec/helpers/setup.ts'],
|
2018-10-15 16:10:18 -04:00
|
|
|
testURL: 'http://localhost',
|
2021-11-29 19:29:57 -05:00
|
|
|
collectCoverageFrom: [
|
|
|
|
'src/**/*.{js,jsx,ts,tsx}',
|
|
|
|
'{packages,plugins}/**/src/**/*.{js,jsx,ts,tsx}',
|
|
|
|
'!**/*.stories.*',
|
|
|
|
'!packages/superset-ui-demo/**/*',
|
|
|
|
],
|
2018-10-15 16:10:18 -04:00
|
|
|
coverageDirectory: '<rootDir>/coverage/',
|
2021-11-29 19:29:57 -05:00
|
|
|
coveragePathIgnorePatterns: [
|
|
|
|
'coverage/',
|
|
|
|
'node_modules/',
|
|
|
|
'public/',
|
|
|
|
'tmp/',
|
|
|
|
'dist/',
|
|
|
|
],
|
|
|
|
coverageReporters: ['lcov', 'json-summary', 'html'],
|
2018-10-24 01:33:51 -04:00
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
2021-05-04 18:26:16 -04:00
|
|
|
snapshotSerializers: ['@emotion/jest/enzyme-serializer'],
|
2020-01-16 00:48:55 -05:00
|
|
|
globals: {
|
2021-11-29 19:29:57 -05:00
|
|
|
__DEV__: true,
|
|
|
|
caches: true,
|
2020-01-16 00:48:55 -05:00
|
|
|
},
|
2018-10-15 16:10:18 -04:00
|
|
|
};
|