From 9a4bf26302c5d582256b90c68a50690c2eb947f2 Mon Sep 17 00:00:00 2001 From: Jaladh Singhal Date: Thu, 25 Jul 2024 16:14:36 -0700 Subject: [PATCH] FIREFLY-1522: Extract jest from package.json in a base config, and override it --- src/suit/jest.config.js | 12 ++++++++++++ src/suit/package.json | 24 ------------------------ 2 files changed, 12 insertions(+), 24 deletions(-) create mode 100644 src/suit/jest.config.js diff --git a/src/suit/jest.config.js b/src/suit/jest.config.js new file mode 100644 index 0000000..a778ed6 --- /dev/null +++ b/src/suit/jest.config.js @@ -0,0 +1,12 @@ +/* eslint-env node */ + +const baseConfig = require('../../__jest__/jest.base.config'); + +module.exports = { + ...baseConfig, + coverageDirectory: '../../build/dist/reports/suit', + moduleNameMapper: { + ...baseConfig.moduleNameMapper, + '^firefly/(.*)$': '/../../../firefly/src/firefly/js/$1' + } +}; \ No newline at end of file diff --git a/src/suit/package.json b/src/suit/package.json index d6da52f..df34be3 100644 --- a/src/suit/package.json +++ b/src/suit/package.json @@ -6,30 +6,6 @@ "test-unit": "node ../../node_modules/jest/bin/jest --passWithNoTests", "test-debug": "node --inspect-brk ../../node_modules/jest/bin/jest --runInBand --passWithNoTests" }, - "jest": { - "moduleFileExtensions": [ - "js", - "jsx" - ], - "moduleDirectories": [ - "node_modules", - "js" - ], - "setupFiles": [ - "/../../__jest__/InitTest.js" - ], - "moduleNameMapper": { - "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/../../__jest__/fileMock.js", - "\\.(css|less)$": "/../../__jest__/styleMock.js", - "^firefly/(.*)$": "/../../../firefly/src/firefly/js/$1" - }, - "transform": { - "^.+\\.jsx?$": "/../../__jest__/jest.transform.js" - }, - "globals": { - "__PROPS__": {} - } - }, "version": "0.0.0", "license": "SEE LICENSE IN License.txt" }