2020-03-02 13:37:00 -05:00
|
|
|
// https://github.com/facebook/jest/issues/3613
|
|
|
|
|
// Yarn Doctor: `npx @yarnpkg/doctor .` -->
|
|
|
|
|
// '<rootDir>' warning:
|
|
|
|
|
// Strings should avoid referencing the node_modules directory (prefer require.resolve)
|
2019-08-13 15:36:46 -04:00
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
verbose: true,
|
2023-05-15 10:09:54 -04:00
|
|
|
// roots: ['<rootDir>/src'],
|
2025-07-11 17:36:49 -03:00
|
|
|
testMatch: ['<rootDir>/src/**/*.test.js', '<rootDir>/src/**/*.test.ts'],
|
2020-03-02 13:37:00 -05:00
|
|
|
testPathIgnorePatterns: ['<rootDir>/node_modules/'],
|
2023-05-08 15:04:39 -03:00
|
|
|
testEnvironment: 'jsdom',
|
2022-07-27 16:39:04 +00:00
|
|
|
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
|
2025-07-11 17:36:49 -03:00
|
|
|
transform: {
|
|
|
|
|
'^.+\\.[jt]sx?$': 'babel-jest',
|
|
|
|
|
},
|
|
|
|
|
transformIgnorePatterns: [],
|
2019-08-13 15:36:46 -04:00
|
|
|
moduleNameMapper: {
|
2020-03-02 13:37:00 -05:00
|
|
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
|
|
|
|
'<rootDir>/src/__mocks__/fileMock.js',
|
|
|
|
|
'\\.(css|less)$': 'identity-obj-proxy',
|
2026-05-19 21:41:37 -04:00
|
|
|
// calculate-suv publishes under dist/ (not dist/esm), so map it explicitly
|
|
|
|
|
// before package-specific catch-all @cornerstonejs mappings.
|
|
|
|
|
'^@cornerstonejs/calculate-suv$': '<rootDir>/../../node_modules/@cornerstonejs/calculate-suv',
|
|
|
|
|
'^@cornerstonejs/calculate-suv/(.*)$':
|
|
|
|
|
'<rootDir>/../../node_modules/@cornerstonejs/calculate-suv/$1',
|
|
|
|
|
'^@cornerstonejs/([^/]+)/(.*)$': '<rootDir>/../../node_modules/@cornerstonejs/$1/dist/esm/$2',
|
|
|
|
|
'^@cornerstonejs/([^/]+)$': '<rootDir>/../../node_modules/@cornerstonejs/$1/dist/esm',
|
2019-08-13 15:36:46 -04:00
|
|
|
},
|
|
|
|
|
// Setup
|
|
|
|
|
// setupFiles: ["jest-canvas-mock/lib/index.js"],
|
|
|
|
|
// Coverage
|
|
|
|
|
reporters: [
|
2020-03-02 13:37:00 -05:00
|
|
|
'default',
|
2019-08-13 15:36:46 -04:00
|
|
|
// Docs: https://www.npmjs.com/package/jest-junit
|
|
|
|
|
[
|
2020-03-02 13:37:00 -05:00
|
|
|
'jest-junit',
|
2019-08-13 15:36:46 -04:00
|
|
|
{
|
2020-03-02 13:37:00 -05:00
|
|
|
addFileAttribute: true, // CircleCI Only
|
|
|
|
|
},
|
|
|
|
|
],
|
2019-08-13 15:36:46 -04:00
|
|
|
],
|
|
|
|
|
collectCoverage: false,
|
|
|
|
|
collectCoverageFrom: [
|
2020-03-02 13:37:00 -05:00
|
|
|
'<rootDir>/src/**/*.{js,jsx}',
|
2019-08-13 15:36:46 -04:00
|
|
|
// Not
|
2020-03-02 13:37:00 -05:00
|
|
|
'!<rootDir>/src/**/*.test.js',
|
|
|
|
|
'!**/node_modules/**',
|
|
|
|
|
'!**/__tests__/**',
|
|
|
|
|
'!<rootDir>/dist/**',
|
|
|
|
|
],
|
2019-08-13 15:36:46 -04:00
|
|
|
};
|