mirror of
https://github.com/gravitational/teleport.git
synced 2026-09-19 01:58:44 +08:00
58 lines
1.6 KiB
JavaScript
58 lines
1.6 KiB
JavaScript
const config = require('@gravitational/build/jest/config');
|
|
|
|
process.env.TZ = 'UTC';
|
|
|
|
const esModules = [
|
|
'strip-ansi',
|
|
'ansi-regex',
|
|
'd3-color',
|
|
'd3-scale',
|
|
'd3-interpolate',
|
|
'd3-time-format',
|
|
'd3-array',
|
|
'd3-format',
|
|
'd3-time',
|
|
'd3-shape',
|
|
'd3-path',
|
|
'internmap',
|
|
'@nivo/bar',
|
|
'react-error-boundary',
|
|
'until-async',
|
|
'@exodus/bytes',
|
|
'rettime',
|
|
'@open-draft/deferred-promise',
|
|
].join('|');
|
|
|
|
/** @type {import('@jest/types').Config.InitialOptions} */
|
|
module.exports = {
|
|
...config,
|
|
globals: {
|
|
electron: {},
|
|
},
|
|
collectCoverageFrom: [
|
|
// comment out until shared directory is finished testing
|
|
// '**/packages/design/src/**/*.jsx',
|
|
'**/packages/shared/components/**/*.jsx',
|
|
],
|
|
// Copied from https://jestjs.io/docs/configuration#transformignorepatterns-arraystring
|
|
// Because in pnpm packages are symlinked to node_modules/.pnpm,
|
|
// we need to transform packages in that directory.
|
|
// We use a relative pattern to match the second 'node_modules/' in
|
|
// 'node_modules/.pnpm/@scope+pkg-b@x.x.x/node_modules/@scope/pkg-b/'.
|
|
transformIgnorePatterns: [`node_modules/(?!.pnpm|${esModules})`],
|
|
transform: {
|
|
'\\.[jt]sx?$': 'babel-jest', // This is the default transform.
|
|
'\\.mjs$': 'babel-jest',
|
|
},
|
|
coverageReporters: ['text-summary', 'lcov'],
|
|
testPathIgnorePatterns: ['e2e'],
|
|
testEnvironmentOptions: {
|
|
customExportConditions: [''],
|
|
},
|
|
setupFilesAfterEnv: [
|
|
'<rootDir>/web/packages/build/jest/setupTests.ts',
|
|
'<rootDir>/web/packages/build/jest/customMatchers.ts',
|
|
'<rootDir>/web/packages/build/jest/canvasMock.ts',
|
|
],
|
|
};
|