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
|
|
|
|
2023-09-27 12:52:36 -04:00
|
|
|
// timezone for unit tests
|
|
|
|
process.env.TZ = 'America/New_York';
|
|
|
|
|
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',
|
2023-02-02 13:23:11 -05:00
|
|
|
// mapping plugins of superset-ui to source code
|
2022-01-07 20:16:24 -05:00
|
|
|
'@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'],
|
2024-06-25 13:56:14 -04:00
|
|
|
testEnvironmentOptions: {
|
|
|
|
url: '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/',
|
|
|
|
],
|
2022-06-09 05:43:42 -04:00
|
|
|
coverageReporters: ['lcov', 'json-summary', 'html', 'text'],
|
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'],
|
2023-03-28 12:32:32 -04:00
|
|
|
transformIgnorePatterns: [
|
2023-06-27 15:12:03 -04:00
|
|
|
'node_modules/(?!d3-(interpolate|color)|remark-gfm|markdown-table|micromark-*.|decode-named-character-reference|character-entities|mdast-util-*.|unist-util-*.|ccount|escape-string-regexp)',
|
2023-03-28 12:32:32 -04:00
|
|
|
],
|
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
|
|
|
},
|
2024-06-25 13:56:14 -04:00
|
|
|
reporters: [
|
|
|
|
'default',
|
|
|
|
[
|
|
|
|
'./node_modules/jest-html-reporter',
|
|
|
|
{
|
|
|
|
pageTitle: 'Test Report',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
2018-10-15 16:10:18 -04:00
|
|
|
};
|