ohif-viewer/jest.config.base.js
Bill Wallace 09093b3f0a
Update to use beta 5.0 of CS3D (#5904)
* Update to use beta 5.0

* fix: unit tests

* fix: Allow slow server/test rendering to still work

* Update tests to use viewport grid compare

* Fix storage of stale retries actual/diff files

* cs3d linking fixees

* Linking for cs3d metadata

* Use metadata import for suv scaling

* Fix suv import

* Use type for import

* fix: Metadata registration ordering

* Use beta for upstream

* Merge from origin/master

* Revert tests to master

* Undo beta version changes

* Revert bun.lock file to that of master.

* Reduce test failure retries to one per test. Cap the number of failed total tests to 10. Replace the JSON reporter with the HTML reporter.

* Add generic provider back in

* Deprecate OHIF versions of cs3d utils

* fix

* Undo some cs3d beta dependencies so this PR could be merged

* Build fix

* Fixing build issues

* build issue

* bun lock

* Temporary cache clear to resolve build issue

* Cache bust

* Remove the babel hoist fix attempt

* Cache netlify toml issue

* Fix netlify cache issue

* Try to fix cache dependency issue

* Try update resolutions

* babel hoist fix

* fix: Remove netlify cache bust

* Revert pinned versions

* PR comments on duplicated suv-factors

* Undo lock changes and isEqual add

---------

Co-authored-by: Joe Boccanfuso <joe.boccanfuso@radicalimaging.com>
Co-authored-by: Alireza <ar.sedghi@gmail.com>
2026-05-19 21:41:37 -04:00

52 lines
1.8 KiB
JavaScript

// 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)
module.exports = {
verbose: true,
// roots: ['<rootDir>/src'],
testMatch: ['<rootDir>/src/**/*.test.js', '<rootDir>/src/**/*.test.ts'],
testPathIgnorePatterns: ['<rootDir>/node_modules/'],
testEnvironment: 'jsdom',
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
},
transformIgnorePatterns: [],
moduleNameMapper: {
'\\.(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',
// 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',
},
// Setup
// setupFiles: ["jest-canvas-mock/lib/index.js"],
// Coverage
reporters: [
'default',
// Docs: https://www.npmjs.com/package/jest-junit
[
'jest-junit',
{
addFileAttribute: true, // CircleCI Only
},
],
],
collectCoverage: false,
collectCoverageFrom: [
'<rootDir>/src/**/*.{js,jsx}',
// Not
'!<rootDir>/src/**/*.test.js',
'!**/node_modules/**',
'!**/__tests__/**',
'!<rootDir>/dist/**',
],
};