diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index 6d2a539533..25731f7682 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -17,6 +17,9 @@ on: NX_CLOUD_ACCESS_TOKEN: required: false description: Token to use Nx Cloud token + CODECOV_TOKEN: + required: false + description: Token Report to Codecov env: NX_SKIP_NX_CACHE: ${{ inputs.skipNxCache }} @@ -70,7 +73,12 @@ jobs: env: testCmd: ${{ inputs.affected && format('test:affected --base=remotes/origin/{0}', github.base_ref || github.ref_name) || 'test'}} NODE_OPTIONS: ${{ runner.os == 'Windows' && '--max_old_space_size=4096' || '' }} - run: yarn ${{ env.testCmd }} + run: yarn ${{ env.testCmd }} --collectCoverage + - name: Upload results to Codecov + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 + with: + flags: unittests + token: ${{ secrets.CODECOV_TOKEN }} - name: Publish tests reports if: always() uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 diff --git a/.github/workflows/it-tests.yml b/.github/workflows/it-tests.yml index 01e2b7c132..48b1f89161 100644 --- a/.github/workflows/it-tests.yml +++ b/.github/workflows/it-tests.yml @@ -12,6 +12,9 @@ on: NX_CLOUD_ACCESS_TOKEN: required: false description: Token to use Nx Cloud token + CODECOV_TOKEN: + required: false + description: Token Report to Codecov env: NX_SKIP_NX_CACHE: ${{ inputs.skipNxCache }} @@ -106,7 +109,12 @@ jobs: shell: bash - name: Test id: it-tests - run: yarn test-int + run: yarn test-int --collectCoverage + - name: Upload results to Codecov + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 + with: + flags: integration + token: ${{ secrets.CODECOV_TOKEN }} - name: Zip generated app on failure if: failure() && steps.it-tests.conclusion == 'failure' run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a7141f69fd..9fb7da07ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,6 +85,7 @@ jobs: uses: ./.github/workflows/code-check.yml secrets: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} needs: [yarn_lock_check] with: affected: ${{ github.event_name == 'pull_request' }} @@ -94,6 +95,7 @@ jobs: uses: ./.github/workflows/it-tests.yml secrets: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} needs: [yarn_lock_check, build] with: skipNxCache: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') }} diff --git a/.vscode/settings.json b/.vscode/settings.json index a257a75b87..11a614e275 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -28,7 +28,10 @@ "typescript.preferences.preferTypeOnlyAutoImports": true, "jest.jestCommandLine": "yarn jest", "jest.debugMode": true, - "jest.runMode": "on-save", + "jest.runMode": { + "type": "on-save", + "coverage": true + }, "testing.openTesting": "neverOpen", "explorer.fileNesting.enabled": true, "explorer.fileNesting.patterns": { diff --git a/apps/chrome-devtools/jest.config.js b/apps/chrome-devtools/jest.config.js index 33a3fd30eb..a395cfb41d 100644 --- a/apps/chrome-devtools/jest.config.js +++ b/apps/chrome-devtools/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../jest.config.ut').getJestGlobalConfig; /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/apps/chrome-devtools/testing/jest.config.ut.js b/apps/chrome-devtools/testing/jest.config.ut.js index 50afe52fd9..ca5548dfff 100644 --- a/apps/chrome-devtools/testing/jest.config.ut.js +++ b/apps/chrome-devtools/testing/jest.config.ut.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, transformIgnorePatterns: ['^.+\\.js$'], globals: { chrome: { diff --git a/apps/github-cascading-app/jest.config.js b/apps/github-cascading-app/jest.config.js index 33a3fd30eb..a395cfb41d 100644 --- a/apps/github-cascading-app/jest.config.js +++ b/apps/github-cascading-app/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../jest.config.ut').getJestGlobalConfig; /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/apps/github-cascading-app/testing/jest.config.ut.js b/apps/github-cascading-app/testing/jest.config.ut.js index 3fe95ed338..a6ad0c43ce 100644 --- a/apps/github-cascading-app/testing/jest.config.ut.js +++ b/apps/github-cascading-app/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/apps/showcase/jest.config.js b/apps/showcase/jest.config.js index 33a3fd30eb..a395cfb41d 100644 --- a/apps/showcase/jest.config.js +++ b/apps/showcase/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../jest.config.ut').getJestGlobalConfig; /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/apps/showcase/testing/jest.config.ut.js b/apps/showcase/testing/jest.config.ut.js index ff25b01b24..ccd265ef7a 100644 --- a/apps/showcase/testing/jest.config.ut.js +++ b/apps/showcase/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/apps/vscode-extension/jest.config.js b/apps/vscode-extension/jest.config.js index 33a3fd30eb..a395cfb41d 100644 --- a/apps/vscode-extension/jest.config.js +++ b/apps/vscode-extension/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../jest.config.ut').getJestGlobalConfig; /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/apps/vscode-extension/testing/jest.config.ut.js b/apps/vscode-extension/testing/jest.config.ut.js index 3fe95ed338..a6ad0c43ce 100644 --- a/apps/vscode-extension/testing/jest.config.ut.js +++ b/apps/vscode-extension/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..995f6491a6 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,12 @@ +codecov: + require_ci_to_pass: false + +comment: + layout: "condensed_header, condensed_files, condensed_footer" + behavior: default + +component_management: + default_rules: + statuses: + - type: project + target: auto diff --git a/jest.config.it.js b/jest.config.it.js index 84cb78effc..2bc92c3668 100644 --- a/jest.config.it.js +++ b/jest.config.it.js @@ -8,7 +8,6 @@ const getJestProjectConfig = require('./jest.config.ut').getJestProjectConfig; */ module.exports.getJestConfig = (rootDir, options) => ({ ...getJestProjectConfig(rootDir, false, options), - rootDir: '..', setupFilesAfterEnv: null, testPathIgnorePatterns: [ '/.*/templates/.*' @@ -21,5 +20,6 @@ module.exports.getJestConfig = (rootDir, options) => ({ ['jest-junit', {outputDirectory: '/dist-test', outputName: 'it-report.xml'}], 'github-actions' ], + coverageReporters: ['cobertura'], testTimeout: 30 * 60 * 1000 }); diff --git a/jest.config.js b/jest.config.js index c1a2f6b7fd..0a46fad09c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,14 +1,19 @@ const { getJestProjects } = require('@o3r/workspace'); +const { getJestGlobalConfig } = require('./jest.config.ut'); -/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ +/** + * Workspace global jest configuration + * Note: It is for IDE Test run and debugging purpose, you may want to run `yarn test` instead + * @type {import('ts-jest/dist/types').JestConfigWithTsJest} + **/ module.exports = { + ...getJestGlobalConfig(__dirname), + coverageReporters: undefined, + reporters: undefined, + passWithNoTests: true, projects: [ ...getJestProjects(__dirname), - ...getJestProjects(__dirname, 'testing/jest.config.*.{j,t}s') + ...getJestProjects(__dirname, 'testing/jest.config.{ut,ut.builders}.{j,t}s') ], - globalSetup: 'jest-preset-angular/global-setup', - reporters: [ - 'default', - 'github-actions' - ] + globalSetup: 'jest-preset-angular/global-setup' }; diff --git a/jest.config.ut.js b/jest.config.ut.js index 76d3df0da3..c47b1c14b1 100644 --- a/jest.config.ut.js +++ b/jest.config.ut.js @@ -26,12 +26,15 @@ module.exports.getJestProjectConfig = (rootDir, isAngularSetup, options) => { return { preset: 'ts-jest', setupFilesAfterEnv: ['/testing/setup-jest.ts'], - rootDir: '.', + rootDir, moduleNameMapper, modulePathIgnorePatterns: [ '/dist', '/src/package.json' ], + testMatch: [ + '/**/*.spec.ts' + ], testPathIgnorePatterns: [ '/.*/templates/.*', '\\.it\\.spec\\.ts$' @@ -75,13 +78,21 @@ module.exports.getJestProjectConfig = (rootDir, isAngularSetup, options) => { * Jest configuration that can be set at root level * @returns {import('ts-jest/dist/types').JestConfigWithTsJest} */ -module.exports.getJestGlobalConfig = () => { +module.exports.getJestGlobalConfig = (rootDir) => { return { testTimeout: 30000, + coverageReporters: ['cobertura'], reporters: [ 'default', - ['jest-junit', {outputDirectory: '/dist-test', outputName: 'ut-report.xml'}], + ['jest-junit', { outputDirectory: '/dist-test', outputName: 'ut-report.xml' }], 'github-actions' ], + rootDir, + testMatch: [ + '/**/*.spec.ts' + ], + testPathIgnorePatterns: [ + '\\.spec\\.ts$' + ] } } diff --git a/nx.json b/nx.json index 31f0e0a096..99cfaa0051 100644 --- a/nx.json +++ b/nx.json @@ -112,18 +112,24 @@ "specs": [ "base", "{projectRoot}/**/*.spec.ts", + "!{projectRoot}/**/*.it.spec.ts", "{projectRoot}/jest.config.*", "{projectRoot}/testing/**/*", + "!{projectRoot}/testing/jest.config.it.js", "{projectRoot}/mocks/**/*", - "{workspaceRoot}/jest.config.ut.js" + "{workspaceRoot}/jest.config.ut.js", + "{workspaceRoot}/codecov.yml" ], "integration-test": [ "base", + "{projectRoot}/testing/jest.config.it.js", + "{projectRoot}/**/*.it.spec.ts", "{workspaceRoot}/jest.config.it.js", "{workspaceRoot}/packages/*/create/src/*.ts", "!{workspaceRoot}/packages/*/create/src/*.spec.ts", "{workspaceRoot}/packages/@o3r/test-helpers/src/**/*.ts", - "!{workspaceRoot}/packages/@o3r/test-helpers/src/**/*.spec.ts" + "!{workspaceRoot}/packages/@o3r/test-helpers/src/**/*.spec.ts", + "{workspaceRoot}/codecov.yml" ], "plugins": [ "base", @@ -161,10 +167,12 @@ }, "builders", "schematics", + "source", "specs" ], "outputs": [ - "{projectRoot}/dist-test/ut-report.xml" + "{projectRoot}/dist-test/ut-report.xml", + "{projectRoot}/coverage/cobertura-coverage.xml" ], "options": { "passWithNoTests": false, @@ -191,12 +199,12 @@ }, "source", "schematics", - "specs", "integration-test", "^schematics" ], "outputs": [ - "{projectRoot}/dist-test/it-report.xml" + "{projectRoot}/dist-test/it-report.xml", + "{projectRoot}/coverage/cobertura-coverage.xml" ], "options": { "quiet": false, diff --git a/packages/@ama-sdk/client-angular/jest.config.js b/packages/@ama-sdk/client-angular/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@ama-sdk/client-angular/jest.config.js +++ b/packages/@ama-sdk/client-angular/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@ama-sdk/client-angular/testing/jest.config.ut.builders.js b/packages/@ama-sdk/client-angular/testing/jest.config.ut.builders.js index ed52ef11a8..c53971c931 100644 --- a/packages/@ama-sdk/client-angular/testing/jest.config.ut.builders.js +++ b/packages/@ama-sdk/client-angular/testing/jest.config.ut.builders.js @@ -2,14 +2,14 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@ama-sdk/client-angular/testing/jest.config.ut.js b/packages/@ama-sdk/client-angular/testing/jest.config.ut.js index 5bb37e4841..2872ab60ff 100644 --- a/packages/@ama-sdk/client-angular/testing/jest.config.ut.js +++ b/packages/@ama-sdk/client-angular/testing/jest.config.ut.js @@ -2,18 +2,18 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@ama-sdk/client-beacon/jest.config.js b/packages/@ama-sdk/client-beacon/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@ama-sdk/client-beacon/jest.config.js +++ b/packages/@ama-sdk/client-beacon/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@ama-sdk/client-beacon/testing/jest.config.ut.builders.js b/packages/@ama-sdk/client-beacon/testing/jest.config.ut.builders.js index ed52ef11a8..c53971c931 100644 --- a/packages/@ama-sdk/client-beacon/testing/jest.config.ut.builders.js +++ b/packages/@ama-sdk/client-beacon/testing/jest.config.ut.builders.js @@ -2,14 +2,14 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@ama-sdk/client-beacon/testing/jest.config.ut.js b/packages/@ama-sdk/client-beacon/testing/jest.config.ut.js index 5bb37e4841..2872ab60ff 100644 --- a/packages/@ama-sdk/client-beacon/testing/jest.config.ut.js +++ b/packages/@ama-sdk/client-beacon/testing/jest.config.ut.js @@ -2,18 +2,18 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@ama-sdk/client-fetch/jest.config.js b/packages/@ama-sdk/client-fetch/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@ama-sdk/client-fetch/jest.config.js +++ b/packages/@ama-sdk/client-fetch/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@ama-sdk/client-fetch/testing/jest.config.ut.builders.js b/packages/@ama-sdk/client-fetch/testing/jest.config.ut.builders.js index ed52ef11a8..c53971c931 100644 --- a/packages/@ama-sdk/client-fetch/testing/jest.config.ut.builders.js +++ b/packages/@ama-sdk/client-fetch/testing/jest.config.ut.builders.js @@ -2,14 +2,14 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@ama-sdk/client-fetch/testing/jest.config.ut.js b/packages/@ama-sdk/client-fetch/testing/jest.config.ut.js index 5bb37e4841..2872ab60ff 100644 --- a/packages/@ama-sdk/client-fetch/testing/jest.config.ut.js +++ b/packages/@ama-sdk/client-fetch/testing/jest.config.ut.js @@ -2,18 +2,18 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@ama-sdk/core/jest.config.js b/packages/@ama-sdk/core/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@ama-sdk/core/jest.config.js +++ b/packages/@ama-sdk/core/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@ama-sdk/core/testing/jest.config.ut.builders.js b/packages/@ama-sdk/core/testing/jest.config.ut.builders.js index ed52ef11a8..c53971c931 100644 --- a/packages/@ama-sdk/core/testing/jest.config.ut.builders.js +++ b/packages/@ama-sdk/core/testing/jest.config.ut.builders.js @@ -2,14 +2,14 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@ama-sdk/core/testing/jest.config.ut.js b/packages/@ama-sdk/core/testing/jest.config.ut.js index 5bb37e4841..2872ab60ff 100644 --- a/packages/@ama-sdk/core/testing/jest.config.ut.js +++ b/packages/@ama-sdk/core/testing/jest.config.ut.js @@ -2,18 +2,18 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@ama-sdk/schematics/jest.config.js b/packages/@ama-sdk/schematics/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@ama-sdk/schematics/jest.config.js +++ b/packages/@ama-sdk/schematics/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@ama-sdk/schematics/testing/jest.config.ut.builders.js b/packages/@ama-sdk/schematics/testing/jest.config.ut.builders.js index 846013647c..4c4e31c208 100644 --- a/packages/@ama-sdk/schematics/testing/jest.config.ut.builders.js +++ b/packages/@ama-sdk/schematics/testing/jest.config.ut.builders.js @@ -2,19 +2,19 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, fakeTimers: { enableGlobally: true, // This is needed to prevent timeout on builders tests advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@ama-sdk/schematics/testing/jest.config.ut.js b/packages/@ama-sdk/schematics/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@ama-sdk/schematics/testing/jest.config.ut.js +++ b/packages/@ama-sdk/schematics/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@ama-sdk/swagger-builder/jest.config.js b/packages/@ama-sdk/swagger-builder/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/packages/@ama-sdk/swagger-builder/jest.config.js +++ b/packages/@ama-sdk/swagger-builder/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@ama-sdk/swagger-builder/testing/jest.config.ut.js b/packages/@ama-sdk/swagger-builder/testing/jest.config.ut.js index 89c2ba937a..83d70fcc0f 100644 --- a/packages/@ama-sdk/swagger-builder/testing/jest.config.ut.js +++ b/packages/@ama-sdk/swagger-builder/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@ama-terasu/cli/jest.config.js b/packages/@ama-terasu/cli/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/packages/@ama-terasu/cli/jest.config.js +++ b/packages/@ama-terasu/cli/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@ama-terasu/cli/testing/jest.config.ut.js b/packages/@ama-terasu/cli/testing/jest.config.ut.js index 89c2ba937a..83d70fcc0f 100644 --- a/packages/@ama-terasu/cli/testing/jest.config.ut.js +++ b/packages/@ama-terasu/cli/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@ama-terasu/core/jest.config.js b/packages/@ama-terasu/core/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/packages/@ama-terasu/core/jest.config.js +++ b/packages/@ama-terasu/core/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@ama-terasu/core/testing/jest.config.ut.js b/packages/@ama-terasu/core/testing/jest.config.ut.js index 89c2ba937a..83d70fcc0f 100644 --- a/packages/@ama-terasu/core/testing/jest.config.ut.js +++ b/packages/@ama-terasu/core/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@ama-terasu/schematics/jest.config.js b/packages/@ama-terasu/schematics/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/packages/@ama-terasu/schematics/jest.config.js +++ b/packages/@ama-terasu/schematics/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@ama-terasu/schematics/testing/jest.config.ut.js b/packages/@ama-terasu/schematics/testing/jest.config.ut.js index 89c2ba937a..83d70fcc0f 100644 --- a/packages/@ama-terasu/schematics/testing/jest.config.ut.js +++ b/packages/@ama-terasu/schematics/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@o3r-training/showcase-sdk/jest.config.js b/packages/@o3r-training/showcase-sdk/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/packages/@o3r-training/showcase-sdk/jest.config.js +++ b/packages/@o3r-training/showcase-sdk/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@o3r-training/showcase-sdk/testing/jest.config.ut.js b/packages/@o3r-training/showcase-sdk/testing/jest.config.ut.js index 2218313f1e..f958b9a435 100644 --- a/packages/@o3r-training/showcase-sdk/testing/jest.config.ut.js +++ b/packages/@o3r-training/showcase-sdk/testing/jest.config.ut.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, moduleNameMapper: { // eslint-disable-next-line @typescript-eslint/naming-convention '^@o3r-training/showcase-sdk$': ['/dist/cjs', '/src'], diff --git a/packages/@o3r-training/training-tools/jest.config.js b/packages/@o3r-training/training-tools/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r-training/training-tools/jest.config.js +++ b/packages/@o3r-training/training-tools/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r-training/training-tools/testing/jest.config.ut.builders.js b/packages/@o3r-training/training-tools/testing/jest.config.ut.builders.js index 5376c49836..2fa33d6566 100644 --- a/packages/@o3r-training/training-tools/testing/jest.config.ut.builders.js +++ b/packages/@o3r-training/training-tools/testing/jest.config.ut.builders.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, testPathIgnorePatterns: [ '/src/.*' ] diff --git a/packages/@o3r-training/training-tools/testing/jest.config.ut.js b/packages/@o3r-training/training-tools/testing/jest.config.ut.js index bc19860de9..0ae76ff148 100644 --- a/packages/@o3r-training/training-tools/testing/jest.config.ut.js +++ b/packages/@o3r-training/training-tools/testing/jest.config.ut.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ '/schematics/.*' ] diff --git a/packages/@o3r/amaterasu/amaterasu-api-spec/jest.config.js b/packages/@o3r/amaterasu/amaterasu-api-spec/jest.config.js index 0050b72475..8c35729687 100644 --- a/packages/@o3r/amaterasu/amaterasu-api-spec/jest.config.js +++ b/packages/@o3r/amaterasu/amaterasu-api-spec/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../../jest.config.ut').getJestGlobalC /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@o3r/amaterasu/amaterasu-api-spec/testing/jest.config.ut.js b/packages/@o3r/amaterasu/amaterasu-api-spec/testing/jest.config.ut.js index 820026df6b..beeee6c1d6 100644 --- a/packages/@o3r/amaterasu/amaterasu-api-spec/testing/jest.config.ut.js +++ b/packages/@o3r/amaterasu/amaterasu-api-spec/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@o3r/amaterasu/amaterasu-dodo/jest.config.js b/packages/@o3r/amaterasu/amaterasu-dodo/jest.config.js index 0050b72475..8c35729687 100644 --- a/packages/@o3r/amaterasu/amaterasu-dodo/jest.config.js +++ b/packages/@o3r/amaterasu/amaterasu-dodo/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../../jest.config.ut').getJestGlobalC /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@o3r/amaterasu/amaterasu-dodo/testing/jest.config.ut.js b/packages/@o3r/amaterasu/amaterasu-dodo/testing/jest.config.ut.js index 820026df6b..beeee6c1d6 100644 --- a/packages/@o3r/amaterasu/amaterasu-dodo/testing/jest.config.ut.js +++ b/packages/@o3r/amaterasu/amaterasu-dodo/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@o3r/amaterasu/amaterasu-otter/jest.config.js b/packages/@o3r/amaterasu/amaterasu-otter/jest.config.js index 0050b72475..8c35729687 100644 --- a/packages/@o3r/amaterasu/amaterasu-otter/jest.config.js +++ b/packages/@o3r/amaterasu/amaterasu-otter/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../../jest.config.ut').getJestGlobalC /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@o3r/amaterasu/amaterasu-otter/testing/jest.config.ut.js b/packages/@o3r/amaterasu/amaterasu-otter/testing/jest.config.ut.js index 820026df6b..beeee6c1d6 100644 --- a/packages/@o3r/amaterasu/amaterasu-otter/testing/jest.config.ut.js +++ b/packages/@o3r/amaterasu/amaterasu-otter/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@o3r/amaterasu/amaterasu-sdk/jest.config.js b/packages/@o3r/amaterasu/amaterasu-sdk/jest.config.js index 0050b72475..8c35729687 100644 --- a/packages/@o3r/amaterasu/amaterasu-sdk/jest.config.js +++ b/packages/@o3r/amaterasu/amaterasu-sdk/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../../jest.config.ut').getJestGlobalC /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/packages/@o3r/amaterasu/amaterasu-sdk/testing/jest.config.ut.js b/packages/@o3r/amaterasu/amaterasu-sdk/testing/jest.config.ut.js index 820026df6b..beeee6c1d6 100644 --- a/packages/@o3r/amaterasu/amaterasu-sdk/testing/jest.config.ut.js +++ b/packages/@o3r/amaterasu/amaterasu-sdk/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/packages/@o3r/analytics/jest.config.js b/packages/@o3r/analytics/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/analytics/jest.config.js +++ b/packages/@o3r/analytics/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/analytics/testing/jest.config.ut.builders.js b/packages/@o3r/analytics/testing/jest.config.ut.builders.js index 831d0d12bf..0a8f36ca81 100644 --- a/packages/@o3r/analytics/testing/jest.config.ut.builders.js +++ b/packages/@o3r/analytics/testing/jest.config.ut.builders.js @@ -2,16 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/analytics/testing/jest.config.ut.js b/packages/@o3r/analytics/testing/jest.config.ut.js index e7e23a4196..4c158fd52d 100644 --- a/packages/@o3r/analytics/testing/jest.config.ut.js +++ b/packages/@o3r/analytics/testing/jest.config.ut.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ '/dist', '/.*/templates/.*', '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/apis-manager/jest.config.js b/packages/@o3r/apis-manager/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/apis-manager/jest.config.js +++ b/packages/@o3r/apis-manager/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/apis-manager/testing/jest.config.ut.builders.js b/packages/@o3r/apis-manager/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/apis-manager/testing/jest.config.ut.builders.js +++ b/packages/@o3r/apis-manager/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/apis-manager/testing/jest.config.ut.js b/packages/@o3r/apis-manager/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/apis-manager/testing/jest.config.ut.js +++ b/packages/@o3r/apis-manager/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/application/jest.config.js b/packages/@o3r/application/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/application/jest.config.js +++ b/packages/@o3r/application/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/application/testing/jest.config.ut.builders.js b/packages/@o3r/application/testing/jest.config.ut.builders.js index 831d0d12bf..0a8f36ca81 100644 --- a/packages/@o3r/application/testing/jest.config.ut.builders.js +++ b/packages/@o3r/application/testing/jest.config.ut.builders.js @@ -2,16 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/application/testing/jest.config.ut.js b/packages/@o3r/application/testing/jest.config.ut.js index e7e23a4196..b8a6025c6b 100644 --- a/packages/@o3r/application/testing/jest.config.ut.js +++ b/packages/@o3r/application/testing/jest.config.ut.js @@ -2,16 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/artifactory-tools/jest.config.js b/packages/@o3r/artifactory-tools/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/artifactory-tools/jest.config.js +++ b/packages/@o3r/artifactory-tools/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/artifactory-tools/testing/jest.config.ut.builders.js b/packages/@o3r/artifactory-tools/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/artifactory-tools/testing/jest.config.ut.builders.js +++ b/packages/@o3r/artifactory-tools/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/artifactory-tools/testing/jest.config.ut.js b/packages/@o3r/artifactory-tools/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@o3r/artifactory-tools/testing/jest.config.ut.js +++ b/packages/@o3r/artifactory-tools/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/azure-tools/jest.config.js b/packages/@o3r/azure-tools/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/azure-tools/jest.config.js +++ b/packages/@o3r/azure-tools/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/azure-tools/testing/jest.config.ut.builders.js b/packages/@o3r/azure-tools/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/azure-tools/testing/jest.config.ut.builders.js +++ b/packages/@o3r/azure-tools/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/azure-tools/testing/jest.config.ut.js b/packages/@o3r/azure-tools/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@o3r/azure-tools/testing/jest.config.ut.js +++ b/packages/@o3r/azure-tools/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/components/jest.config.js b/packages/@o3r/components/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/components/jest.config.js +++ b/packages/@o3r/components/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/components/testing/jest.config.ut.builders.js b/packages/@o3r/components/testing/jest.config.ut.builders.js index 6eef316104..cf05b44a5f 100644 --- a/packages/@o3r/components/testing/jest.config.ut.builders.js +++ b/packages/@o3r/components/testing/jest.config.ut.builders.js @@ -2,21 +2,20 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], fakeTimers: { - enableGlobally: true, + ...baseConfig.fakeTimers, // This is needed to prevent timeout on builders tests advanceTimers: true }, testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/components/testing/jest.config.ut.js b/packages/@o3r/components/testing/jest.config.ut.js index ed5a4476b6..478209709b 100644 --- a/packages/@o3r/components/testing/jest.config.ut.js +++ b/packages/@o3r/components/testing/jest.config.ut.js @@ -1,5 +1,6 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; + const rootDir = path.join(__dirname, '..'); const defaultConfig = getJestProjectConfig(rootDir, true); @@ -7,7 +8,6 @@ const defaultConfig = getJestProjectConfig(rootDir, true); module.exports = { ...defaultConfig, displayName: require('../package.json').name, - rootDir, moduleNameMapper: { ...defaultConfig.moduleNameMapper, // eslint-disable-next-line @typescript-eslint/naming-convention @@ -16,10 +16,8 @@ module.exports = { '^@o3r/testing/core/(.*)$': ['/../../@o3r/testing/src/core/angular/$1'] }, testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', + ...defaultConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/configuration/jest.config.js b/packages/@o3r/configuration/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/configuration/jest.config.js +++ b/packages/@o3r/configuration/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/configuration/testing/jest.config.ut.builders.js b/packages/@o3r/configuration/testing/jest.config.ut.builders.js index 831d0d12bf..0a8f36ca81 100644 --- a/packages/@o3r/configuration/testing/jest.config.ut.builders.js +++ b/packages/@o3r/configuration/testing/jest.config.ut.builders.js @@ -2,16 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/configuration/testing/jest.config.ut.js b/packages/@o3r/configuration/testing/jest.config.ut.js index e7e23a4196..b8a6025c6b 100644 --- a/packages/@o3r/configuration/testing/jest.config.ut.js +++ b/packages/@o3r/configuration/testing/jest.config.ut.js @@ -2,16 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/core/jest.config.js b/packages/@o3r/core/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/core/jest.config.js +++ b/packages/@o3r/core/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/core/testing/jest.config.ut.builders.js b/packages/@o3r/core/testing/jest.config.ut.builders.js index 240be10b0f..57fbf05265 100644 --- a/packages/@o3r/core/testing/jest.config.ut.builders.js +++ b/packages/@o3r/core/testing/jest.config.ut.builders.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], fakeTimers: { enableGlobally: true, @@ -14,8 +15,7 @@ module.exports = { advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/core/testing/jest.config.ut.js b/packages/@o3r/core/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/core/testing/jest.config.ut.js +++ b/packages/@o3r/core/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/design/jest.config.js b/packages/@o3r/design/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/design/jest.config.js +++ b/packages/@o3r/design/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/design/testing/jest.config.ut.builders.js b/packages/@o3r/design/testing/jest.config.ut.builders.js index 2ca82b13cf..dab9f391f6 100644 --- a/packages/@o3r/design/testing/jest.config.ut.builders.js +++ b/packages/@o3r/design/testing/jest.config.ut.builders.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ], clearMocks: true }; diff --git a/packages/@o3r/design/testing/jest.config.ut.js b/packages/@o3r/design/testing/jest.config.ut.js index b232bf3ac8..7c3dab1f4e 100644 --- a/packages/@o3r/design/testing/jest.config.ut.js +++ b/packages/@o3r/design/testing/jest.config.ut.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ], clearMocks: true }; diff --git a/packages/@o3r/dev-tools/jest.config.js b/packages/@o3r/dev-tools/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/dev-tools/jest.config.js +++ b/packages/@o3r/dev-tools/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/dev-tools/testing/jest.config.ut.builders.js b/packages/@o3r/dev-tools/testing/jest.config.ut.builders.js index 831d0d12bf..0fa6e1e0cd 100644 --- a/packages/@o3r/dev-tools/testing/jest.config.ut.builders.js +++ b/packages/@o3r/dev-tools/testing/jest.config.ut.builders.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ '/dist', '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + '/src/.*' ] }; diff --git a/packages/@o3r/dev-tools/testing/jest.config.ut.js b/packages/@o3r/dev-tools/testing/jest.config.ut.js index 6652213606..2055e275c7 100644 --- a/packages/@o3r/dev-tools/testing/jest.config.ut.js +++ b/packages/@o3r/dev-tools/testing/jest.config.ut.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ '/dist', '/.*/templates/.*', '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/dynamic-content/jest.config.js b/packages/@o3r/dynamic-content/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/dynamic-content/jest.config.js +++ b/packages/@o3r/dynamic-content/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/dynamic-content/testing/jest.config.ut.builders.js b/packages/@o3r/dynamic-content/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/dynamic-content/testing/jest.config.ut.builders.js +++ b/packages/@o3r/dynamic-content/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/dynamic-content/testing/jest.config.ut.js b/packages/@o3r/dynamic-content/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/dynamic-content/testing/jest.config.ut.js +++ b/packages/@o3r/dynamic-content/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/eslint-config-otter/jest.config.js b/packages/@o3r/eslint-config-otter/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/eslint-config-otter/jest.config.js +++ b/packages/@o3r/eslint-config-otter/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/eslint-config-otter/testing/jest.config.ut.builders.js b/packages/@o3r/eslint-config-otter/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/eslint-config-otter/testing/jest.config.ut.builders.js +++ b/packages/@o3r/eslint-config-otter/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/eslint-config-otter/testing/jest.config.ut.js b/packages/@o3r/eslint-config-otter/testing/jest.config.ut.js index 1d202c4c96..b9df3af204 100644 --- a/packages/@o3r/eslint-config-otter/testing/jest.config.ut.js +++ b/packages/@o3r/eslint-config-otter/testing/jest.config.ut.js @@ -2,19 +2,19 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true, advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/eslint-plugin/jest.config.js b/packages/@o3r/eslint-plugin/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/eslint-plugin/jest.config.js +++ b/packages/@o3r/eslint-plugin/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/eslint-plugin/testing/jest.config.ut.builders.js b/packages/@o3r/eslint-plugin/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/eslint-plugin/testing/jest.config.ut.builders.js +++ b/packages/@o3r/eslint-plugin/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/eslint-plugin/testing/jest.config.ut.js b/packages/@o3r/eslint-plugin/testing/jest.config.ut.js index 1d202c4c96..b9df3af204 100644 --- a/packages/@o3r/eslint-plugin/testing/jest.config.ut.js +++ b/packages/@o3r/eslint-plugin/testing/jest.config.ut.js @@ -2,19 +2,19 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true, advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/extractors/jest.config.js b/packages/@o3r/extractors/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/extractors/jest.config.js +++ b/packages/@o3r/extractors/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/extractors/testing/jest.config.ut.builders.js b/packages/@o3r/extractors/testing/jest.config.ut.builders.js index 240be10b0f..57fbf05265 100644 --- a/packages/@o3r/extractors/testing/jest.config.ut.builders.js +++ b/packages/@o3r/extractors/testing/jest.config.ut.builders.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], fakeTimers: { enableGlobally: true, @@ -14,8 +15,7 @@ module.exports = { advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/extractors/testing/jest.config.ut.js b/packages/@o3r/extractors/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@o3r/extractors/testing/jest.config.ut.js +++ b/packages/@o3r/extractors/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/forms/jest.config.js b/packages/@o3r/forms/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/forms/jest.config.js +++ b/packages/@o3r/forms/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/forms/testing/jest.config.ut.builders.js b/packages/@o3r/forms/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/forms/testing/jest.config.ut.builders.js +++ b/packages/@o3r/forms/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/forms/testing/jest.config.ut.js b/packages/@o3r/forms/testing/jest.config.ut.js index 9b8c5c8ff4..b5be723165 100644 --- a/packages/@o3r/forms/testing/jest.config.ut.js +++ b/packages/@o3r/forms/testing/jest.config.ut.js @@ -2,18 +2,18 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/localization/jest.config.js b/packages/@o3r/localization/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/localization/jest.config.js +++ b/packages/@o3r/localization/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/localization/testing/jest.config.ut.builders.js b/packages/@o3r/localization/testing/jest.config.ut.builders.js index 240be10b0f..57fbf05265 100644 --- a/packages/@o3r/localization/testing/jest.config.ut.builders.js +++ b/packages/@o3r/localization/testing/jest.config.ut.builders.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], fakeTimers: { enableGlobally: true, @@ -14,8 +15,7 @@ module.exports = { advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/localization/testing/jest.config.ut.js b/packages/@o3r/localization/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/localization/testing/jest.config.ut.js +++ b/packages/@o3r/localization/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/logger/jest.config.js b/packages/@o3r/logger/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/logger/jest.config.js +++ b/packages/@o3r/logger/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/logger/testing/jest.config.ut.builders.js b/packages/@o3r/logger/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/logger/testing/jest.config.ut.builders.js +++ b/packages/@o3r/logger/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/logger/testing/jest.config.ut.js b/packages/@o3r/logger/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/logger/testing/jest.config.ut.js +++ b/packages/@o3r/logger/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/mobile/jest.config.js b/packages/@o3r/mobile/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/mobile/jest.config.js +++ b/packages/@o3r/mobile/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/mobile/testing/jest.config.ut.builders.js b/packages/@o3r/mobile/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/mobile/testing/jest.config.ut.builders.js +++ b/packages/@o3r/mobile/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/mobile/testing/jest.config.ut.js b/packages/@o3r/mobile/testing/jest.config.ut.js index cbc042ef90..7e45944dc4 100644 --- a/packages/@o3r/mobile/testing/jest.config.ut.js +++ b/packages/@o3r/mobile/testing/jest.config.ut.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, transformIgnorePatterns: ['^.+\\.js$'], testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/new-version/jest.config.js b/packages/@o3r/new-version/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/new-version/jest.config.js +++ b/packages/@o3r/new-version/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/new-version/testing/jest.config.ut.builders.js b/packages/@o3r/new-version/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/new-version/testing/jest.config.ut.builders.js +++ b/packages/@o3r/new-version/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/new-version/testing/jest.config.ut.js b/packages/@o3r/new-version/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@o3r/new-version/testing/jest.config.ut.js +++ b/packages/@o3r/new-version/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/pipeline/jest.config.js b/packages/@o3r/pipeline/jest.config.js index 514274fa25..f7f156a0db 100644 --- a/packages/@o3r/pipeline/jest.config.js +++ b/packages/@o3r/pipeline/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.builders.js' ] diff --git a/packages/@o3r/pipeline/testing/jest.config.ut.builders.js b/packages/@o3r/pipeline/testing/jest.config.ut.builders.js index 24b0ee1db9..6624ef1a03 100644 --- a/packages/@o3r/pipeline/testing/jest.config.ut.builders.js +++ b/packages/@o3r/pipeline/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ], clearMocks: true }; diff --git a/packages/@o3r/routing/jest.config.js b/packages/@o3r/routing/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/routing/jest.config.js +++ b/packages/@o3r/routing/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/routing/testing/jest.config.ut.builders.js b/packages/@o3r/routing/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/routing/testing/jest.config.ut.builders.js +++ b/packages/@o3r/routing/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/routing/testing/jest.config.ut.js b/packages/@o3r/routing/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/routing/testing/jest.config.ut.js +++ b/packages/@o3r/routing/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/rules-engine/jest.config.js b/packages/@o3r/rules-engine/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/rules-engine/jest.config.js +++ b/packages/@o3r/rules-engine/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/rules-engine/testing/jest.config.ut.builders.js b/packages/@o3r/rules-engine/testing/jest.config.ut.builders.js index a089687e7a..05968b5a4b 100644 --- a/packages/@o3r/rules-engine/testing/jest.config.ut.builders.js +++ b/packages/@o3r/rules-engine/testing/jest.config.ut.builders.js @@ -2,20 +2,21 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], fakeTimers: { - enableGlobally: true, + ...baseConfig.fakeTimers, // This is needed to prevent timeout on builders tests advanceTimers: true }, testPathIgnorePatterns: [ + ...baseConfig.testPathIgnorePatterns, '/.*/(?:mocks|templates)/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + '/src/.*' ] }; diff --git a/packages/@o3r/rules-engine/testing/jest.config.ut.js b/packages/@o3r/rules-engine/testing/jest.config.ut.js index 9286a512f7..b2b1150296 100644 --- a/packages/@o3r/rules-engine/testing/jest.config.ut.js +++ b/packages/@o3r/rules-engine/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ '/.*/(?:mocks|templates)/.*', '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/schematics/jest.config.js b/packages/@o3r/schematics/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/schematics/jest.config.js +++ b/packages/@o3r/schematics/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/schematics/testing/jest.config.ut.builders.js b/packages/@o3r/schematics/testing/jest.config.ut.builders.js index ed52ef11a8..c53971c931 100644 --- a/packages/@o3r/schematics/testing/jest.config.ut.builders.js +++ b/packages/@o3r/schematics/testing/jest.config.ut.builders.js @@ -2,14 +2,14 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/schematics/testing/jest.config.ut.js b/packages/@o3r/schematics/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@o3r/schematics/testing/jest.config.ut.js +++ b/packages/@o3r/schematics/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/store-sync/jest.config.js b/packages/@o3r/store-sync/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/store-sync/jest.config.js +++ b/packages/@o3r/store-sync/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/store-sync/testing/jest.config.ut.builders.js b/packages/@o3r/store-sync/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/store-sync/testing/jest.config.ut.builders.js +++ b/packages/@o3r/store-sync/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/store-sync/testing/jest.config.ut.js b/packages/@o3r/store-sync/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/store-sync/testing/jest.config.ut.js +++ b/packages/@o3r/store-sync/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/storybook/jest.config.js b/packages/@o3r/storybook/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/storybook/jest.config.js +++ b/packages/@o3r/storybook/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/storybook/testing/jest.config.ut.builders.js b/packages/@o3r/storybook/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/storybook/testing/jest.config.ut.builders.js +++ b/packages/@o3r/storybook/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/storybook/testing/jest.config.ut.js b/packages/@o3r/storybook/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@o3r/storybook/testing/jest.config.ut.js +++ b/packages/@o3r/storybook/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/stylelint-plugin/jest.config.js b/packages/@o3r/stylelint-plugin/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/stylelint-plugin/jest.config.js +++ b/packages/@o3r/stylelint-plugin/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/stylelint-plugin/testing/jest.config.ut.builders.js b/packages/@o3r/stylelint-plugin/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/stylelint-plugin/testing/jest.config.ut.builders.js +++ b/packages/@o3r/stylelint-plugin/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/stylelint-plugin/testing/jest.config.ut.js b/packages/@o3r/stylelint-plugin/testing/jest.config.ut.js index aa0a664828..fd59e0d7a7 100644 --- a/packages/@o3r/stylelint-plugin/testing/jest.config.ut.js +++ b/packages/@o3r/stylelint-plugin/testing/jest.config.ut.js @@ -2,20 +2,20 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, resolver: '/testing/mjs-resolver.js', testEnvironmentOptions: { // workaround to use stylelint CommonJs interface customExportConditions: ['require'] }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/styling/jest.config.js b/packages/@o3r/styling/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/styling/jest.config.js +++ b/packages/@o3r/styling/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/styling/testing/jest.config.ut.builders.js b/packages/@o3r/styling/testing/jest.config.ut.builders.js index 240be10b0f..57fbf05265 100644 --- a/packages/@o3r/styling/testing/jest.config.ut.builders.js +++ b/packages/@o3r/styling/testing/jest.config.ut.builders.js @@ -2,11 +2,12 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], fakeTimers: { enableGlobally: true, @@ -14,8 +15,7 @@ module.exports = { advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/styling/testing/jest.config.ut.js b/packages/@o3r/styling/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/styling/testing/jest.config.ut.js +++ b/packages/@o3r/styling/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/telemetry/jest.config.js b/packages/@o3r/telemetry/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/telemetry/jest.config.js +++ b/packages/@o3r/telemetry/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/telemetry/testing/jest.config.ut.builders.js b/packages/@o3r/telemetry/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/telemetry/testing/jest.config.ut.builders.js +++ b/packages/@o3r/telemetry/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/telemetry/testing/jest.config.ut.js b/packages/@o3r/telemetry/testing/jest.config.ut.js index 05e7f7970c..9ae5574328 100644 --- a/packages/@o3r/telemetry/testing/jest.config.ut.js +++ b/packages/@o3r/telemetry/testing/jest.config.ut.js @@ -2,20 +2,20 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, fakeTimers: { enableGlobally: true, // This is needed to prevent timeout on builders tests advanceTimers: true }, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/test-helpers/jest.config.js b/packages/@o3r/test-helpers/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/test-helpers/jest.config.js +++ b/packages/@o3r/test-helpers/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/test-helpers/testing/jest.config.ut.builders.js b/packages/@o3r/test-helpers/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/test-helpers/testing/jest.config.ut.builders.js +++ b/packages/@o3r/test-helpers/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/test-helpers/testing/jest.config.ut.js b/packages/@o3r/test-helpers/testing/jest.config.ut.js index 5eb96361ac..338c8c0406 100644 --- a/packages/@o3r/test-helpers/testing/jest.config.ut.js +++ b/packages/@o3r/test-helpers/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/testing/jest.config.js b/packages/@o3r/testing/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/testing/jest.config.js +++ b/packages/@o3r/testing/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/testing/schematics/ng-add/templates/project/jest.config.js.template b/packages/@o3r/testing/schematics/ng-add/templates/project/jest.config.js.template index 89d0949363..59c3e10bd9 100644 --- a/packages/@o3r/testing/schematics/ng-add/templates/project/jest.config.js.template +++ b/packages/@o3r/testing/schematics/ng-add/templates/project/jest.config.js.template @@ -1,13 +1,10 @@ const getJestProjectConfig = require('<%= rootRelativePath %>/jest.config.ut').getJestProjectConfig; +const baseConfig = getJestProjectConfig(__dirname, <%= isAngularSetup %>); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(__dirname, <%= isAngularSetup %>), - displayName: require('./package.json').name, - testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', - '\\.it\\.spec\\.ts$' - ] + ...baseConfig, + displayName: require('./package.json').name }; diff --git a/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.js.template b/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.js.template index ebd914fe09..932ad22d8e 100644 --- a/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.js.template +++ b/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.js.template @@ -1,7 +1,10 @@ const { getJestProjects } = require('@o3r/workspace'); +const { getJestGlobalConfig } = require('./jest.config.ut'); /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { + ...getJestGlobalConfig(__dirname), + passWithNoTests: true, projects: getJestProjects(__dirname), globalSetup: 'jest-preset-angular/global-setup', reporters: [ diff --git a/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.ut.js.template b/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.ut.js.template index 35e3244f72..fc31b6fefe 100644 --- a/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.ut.js.template +++ b/packages/@o3r/testing/schematics/ng-add/templates/workspace/jest.config.ut.js.template @@ -28,7 +28,7 @@ module.exports.getJestProjectConfig = (rootDir, isAngularSetup) => { return { preset: 'ts-jest', setupFilesAfterEnv: ['/testing/setup-jest.ts'], - rootDir: '.', + rootDir, moduleNameMapper, modulePathIgnorePatterns: [ '/dist' @@ -72,8 +72,19 @@ module.exports.getJestProjectConfig = (rootDir, isAngularSetup) => { }; }; -module.exports.getJestGlobalConfig = () => { +/** +* @param rootDir {string} Root directory, default to '.' +* @returns {import('ts-jest/dist/types').JestConfigWithTsJest} +*/ +module.exports.getJestGlobalConfig = (rootDir) => { return { + rootDir: rootDir || '.', + testMatch: [ + '/**/*.spec.ts' + ], + testPathIgnorePatterns: [ + '\\.spec\\.ts$' + ], reporters: [ 'default', ['jest-junit', {outputDirectory: '/dist-test', outputName: 'ut-report.xml'}], diff --git a/packages/@o3r/testing/testing/jest.config.ut.builders.js b/packages/@o3r/testing/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/testing/testing/jest.config.ut.builders.js +++ b/packages/@o3r/testing/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/testing/testing/jest.config.ut.js b/packages/@o3r/testing/testing/jest.config.ut.js index b1fc8755b8..b8a6025c6b 100644 --- a/packages/@o3r/testing/testing/jest.config.ut.js +++ b/packages/@o3r/testing/testing/jest.config.ut.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/third-party/jest.config.js b/packages/@o3r/third-party/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/third-party/jest.config.js +++ b/packages/@o3r/third-party/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/third-party/testing/jest.config.ut.builders.js b/packages/@o3r/third-party/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/third-party/testing/jest.config.ut.builders.js +++ b/packages/@o3r/third-party/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/third-party/testing/jest.config.ut.js b/packages/@o3r/third-party/testing/jest.config.ut.js index cbc042ef90..7e45944dc4 100644 --- a/packages/@o3r/third-party/testing/jest.config.ut.js +++ b/packages/@o3r/third-party/testing/jest.config.ut.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, transformIgnorePatterns: ['^.+\\.js$'], testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/packages/@o3r/workspace/jest.config.js b/packages/@o3r/workspace/jest.config.js index 237fd70fc2..e940e10f49 100644 --- a/packages/@o3r/workspace/jest.config.js +++ b/packages/@o3r/workspace/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js', '/testing/jest.config.ut.builders.js' diff --git a/packages/@o3r/workspace/schematics/sdk/templates/jest.config.js.template b/packages/@o3r/workspace/schematics/sdk/templates/jest.config.js.template index 91743da9c5..8d449e603c 100644 --- a/packages/@o3r/workspace/schematics/sdk/templates/jest.config.js.template +++ b/packages/@o3r/workspace/schematics/sdk/templates/jest.config.js.template @@ -1,12 +1,9 @@ const getJestProjectConfig = require('<%= rootRelativePath %>/jest.config.ut').getJestProjectConfig; +const baseConfig = getJestProjectConfig(__dirname, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(__dirname, false), - displayName: require('./package.json').name, - testPathIgnorePatterns: [ - '/dist', - '/.*/templates/.*', - '\\.it\\.spec\\.ts$' - ] + ...baseConfig, + displayName: require('./package.json').name }; diff --git a/packages/@o3r/workspace/testing/jest.config.ut.builders.js b/packages/@o3r/workspace/testing/jest.config.ut.builders.js index aa8c5dc6af..0a8f36ca81 100644 --- a/packages/@o3r/workspace/testing/jest.config.ut.builders.js +++ b/packages/@o3r/workspace/testing/jest.config.ut.builders.js @@ -2,15 +2,15 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: `${require('../package.json').name}/builders`, - rootDir, setupFilesAfterEnv: ['/testing/setup-jest.builders.ts'], testPathIgnorePatterns: [ - '/.*/templates/.*', - '/src/.*', - '\\.it\\.spec\\.ts$' + ...baseConfig.testPathIgnorePatterns, + '/src/.*' ] }; diff --git a/packages/@o3r/workspace/testing/jest.config.ut.js b/packages/@o3r/workspace/testing/jest.config.ut.js index cbc042ef90..7e45944dc4 100644 --- a/packages/@o3r/workspace/testing/jest.config.ut.js +++ b/packages/@o3r/workspace/testing/jest.config.ut.js @@ -2,16 +2,16 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, true); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, true), + ...baseConfig, displayName: require('../package.json').name, - rootDir, transformIgnorePatterns: ['^.+\\.js$'], testPathIgnorePatterns: [ - '/.*/templates/.*', + ...baseConfig.testPathIgnorePatterns, '/builders/.*', - '/schematics/.*', - '\\.it\\.spec\\.ts$' + '/schematics/.*' ] }; diff --git a/tools/github-actions/audit/jest.config.js b/tools/github-actions/audit/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/tools/github-actions/audit/jest.config.js +++ b/tools/github-actions/audit/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/tools/github-actions/audit/testing/jest.config.ut.js b/tools/github-actions/audit/testing/jest.config.ut.js index 89c2ba937a..83d70fcc0f 100644 --- a/tools/github-actions/audit/testing/jest.config.ut.js +++ b/tools/github-actions/audit/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/tools/github-actions/cascading/jest.config.js b/tools/github-actions/cascading/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/tools/github-actions/cascading/jest.config.js +++ b/tools/github-actions/cascading/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/tools/github-actions/cascading/testing/jest.config.ut.js b/tools/github-actions/cascading/testing/jest.config.ut.js index 89c2ba937a..83d70fcc0f 100644 --- a/tools/github-actions/cascading/testing/jest.config.ut.js +++ b/tools/github-actions/cascading/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/tools/github-actions/new-version/jest.config.js b/tools/github-actions/new-version/jest.config.js index 7ab5db4b94..ab52050533 100644 --- a/tools/github-actions/new-version/jest.config.js +++ b/tools/github-actions/new-version/jest.config.js @@ -2,7 +2,7 @@ const getJestGlobalConfig = require('../../../jest.config.ut').getJestGlobalConf /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestGlobalConfig(), + ...getJestGlobalConfig(__dirname), projects: [ '/testing/jest.config.ut.js' ] diff --git a/tools/github-actions/new-version/testing/jest.config.ut.js b/tools/github-actions/new-version/testing/jest.config.ut.js index 89c2ba937a..83d70fcc0f 100644 --- a/tools/github-actions/new-version/testing/jest.config.ut.js +++ b/tools/github-actions/new-version/testing/jest.config.ut.js @@ -2,9 +2,10 @@ const path = require('node:path'); const getJestProjectConfig = require('../../../../jest.config.ut').getJestProjectConfig; const rootDir = path.join(__dirname, '..'); +const baseConfig = getJestProjectConfig(rootDir, false); + /** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { - ...getJestProjectConfig(rootDir, false), + ...baseConfig, displayName: require('../package.json').name, - rootDir }; diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index e73b917ea6..c4e1820b26 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -4,6 +4,7 @@ ".github/**/*.mjs", ".eslintrc.js", "jest.config.js", + "jest.config.*.js", "testing/*", "scripts/**/*.js", "scripts/**/*.mjs",