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.
|
|
|
|
*/
|
2018-10-15 16:10:18 -04:00
|
|
|
module.exports = {
|
2020-08-19 15:54:26 -04:00
|
|
|
testRegex: '(\\/spec|\\/src)\\/.*(_spec|\\.test)\\.(j|t)sx?$',
|
2018-10-15 16:10:18 -04:00
|
|
|
moduleNameMapper: {
|
|
|
|
'\\.(css|less)$': '<rootDir>/spec/__mocks__/styleMock.js',
|
2020-06-16 20:30:10 -04:00
|
|
|
'\\.(gif|ttf|eot)$': '<rootDir>/spec/__mocks__/fileMock.js',
|
|
|
|
'\\.svg$': '<rootDir>/spec/__mocks__/svgrMock.js',
|
2018-10-24 01:33:51 -04:00
|
|
|
'^src/(.*)$': '<rootDir>/src/$1',
|
2020-07-16 19:07:49 -04:00
|
|
|
'^spec/(.*)$': '<rootDir>/spec/$1',
|
2018-10-15 16:10:18 -04:00
|
|
|
},
|
2021-02-16 11:48:16 -05:00
|
|
|
testEnvironment: 'jsdom',
|
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-04-16 02:17:31 -04:00
|
|
|
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!**/*.stories.*'],
|
2018-10-15 16:10:18 -04:00
|
|
|
coverageDirectory: '<rootDir>/coverage/',
|
2018-10-24 01:33:51 -04:00
|
|
|
transform: {
|
|
|
|
'^.+\\.jsx?$': 'babel-jest',
|
|
|
|
'^.+\\.tsx?$': 'ts-jest',
|
|
|
|
},
|
|
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
2020-01-16 00:48:55 -05:00
|
|
|
globals: {
|
|
|
|
'ts-jest': {
|
2020-04-13 16:39:55 -04:00
|
|
|
babelConfig: true,
|
2020-01-16 00:48:55 -05:00
|
|
|
diagnostics: {
|
|
|
|
warnOnly: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2018-10-15 16:10:18 -04:00
|
|
|
};
|