diff --git a/packages/cli/jest.config.ts b/packages/cli/jest.config.ts index f3ba355b8..c3f953f6f 100644 --- a/packages/cli/jest.config.ts +++ b/packages/cli/jest.config.ts @@ -1,7 +1,11 @@ -import { merge, Config } from '@silverhand/jest-config'; +import type { Config } from '@silverhand/jest-config'; +import { merge } from '@silverhand/jest-config'; const config: Config.InitialOptions = merge({ roots: ['./src'], + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, }); export default config; diff --git a/packages/core/jest.config.ts b/packages/core/jest.config.ts index 9de583529..64ca0ec7b 100644 --- a/packages/core/jest.config.ts +++ b/packages/core/jest.config.ts @@ -2,19 +2,12 @@ import type { Config } from '@silverhand/jest-config'; import { merge } from '@silverhand/jest-config'; const config: Config.InitialOptions = merge({ - preset: 'ts-jest/presets/js-with-ts-esm', testPathIgnorePatterns: ['/core/connectors/'], setupFilesAfterEnv: ['jest-matcher-specific-error', './jest.setup.ts'], moduleNameMapper: { '^#src/(.*)\\.js(x)?$': '/src/$1', '^(\\.{1,2}/.*)\\.js$': '$1', }, - globals: { - 'ts-jest': { - useESM: true, - }, - }, - extensionsToTreatAsEsm: ['.ts', '.tsx'], }); export default config; diff --git a/packages/demo-app/package.json b/packages/demo-app/package.json index 055684270..69d6298b4 100644 --- a/packages/demo-app/package.json +++ b/packages/demo-app/package.json @@ -6,7 +6,6 @@ "license": "MPL-2.0", "private": true, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", "precommit": "lint-staged", "start": "parcel src/index.html", "dev": "cross-env PORT=5003 parcel src/index.html --public-url /demo-app --no-cache --hmr-port 6003", diff --git a/packages/schemas/jest.config.ts b/packages/schemas/jest.config.ts index 0a9aa1b2e..225bc6319 100644 --- a/packages/schemas/jest.config.ts +++ b/packages/schemas/jest.config.ts @@ -1 +1,10 @@ -export { default } from '@silverhand/jest-config'; +import type { Config } from '@silverhand/jest-config'; +import { merge } from '@silverhand/jest-config'; + +const config: Config.InitialOptions = merge({ + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, +}); + +export default config; diff --git a/packages/shared/jest.config.ts b/packages/shared/jest.config.ts index f3ba355b8..c3f953f6f 100644 --- a/packages/shared/jest.config.ts +++ b/packages/shared/jest.config.ts @@ -1,7 +1,11 @@ -import { merge, Config } from '@silverhand/jest-config'; +import type { Config } from '@silverhand/jest-config'; +import { merge } from '@silverhand/jest-config'; const config: Config.InitialOptions = merge({ roots: ['./src'], + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, }); export default config;