forked from ImagingDataCommons/dicom-microscopy-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
36 lines (36 loc) · 1.42 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
roots: [
'<rootDir>',
'<rootDir>/src'
],
moduleDirectories: [
'node_modules'
],
moduleFileExtensions: ['js', 'wasm', 'json'],
transform: {
'^.+wasm.*\\.js$': '<rootDir>/src/__mocks__/emscriptenMock.js',
'^.+\\.js$': 'babel-jest',
'\\.(css|less|sass|scss)$': '<rootDir>/src/__mocks__/styleMock.js',
'\\.(wasm)$': '<rootDir>/src/__mocks__/wasmMock.js'
},
transformIgnorePatterns: [
'node_modules/(?!(ol|@cornerstonejs|dicomicc)/)' // <- transform libraries
],
testMatch: [
'<rootDir>/src/**/*.test.js'
],
testPathIgnorePatterns: [
'<rootDir>/node_modules'
],
setupFiles: ['jest-canvas-mock'],
moduleNameMapper: {
'@cornerstonejs/codec-libjpeg-turbo-8bit/decodewasmjs': '@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode',
'@cornerstonejs/codec-libjpeg-turbo-8bit/decodewasm': '@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.wasm',
'@cornerstonejs/codec-charls/decodewasmjs': '@cornerstonejs/codec-charls/dist/charlswasm_decode.js',
'@cornerstonejs/codec-charls/decodewasm': '@cornerstonejs/codec-charls/dist/charlswasm_decode.wasm',
'@cornerstonejs/codec-openjpeg/decodewasmjs': '@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.js',
'@cornerstonejs/codec-openjpeg/decodewasm': '@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.wasm',
},
}