0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/console/jest.config.ts
Gao Sun 20418dc4f9
refactor(console,ui,demo-app): fix i18next types (#3743)
* refactor(console,ui,demo-app): fix i18next types

disable allowObjectInHTMLChildren for safer typing. use <DynamicT /> for
all dynamic translations.

* fix(console): i18n key in UserAccountInformation

* refactor(console,ui): update <DynamicT /> and add tests
2023-04-24 16:05:26 +08:00

33 lines
886 B
TypeScript

import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
roots: ['<rootDir>/src'],
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
transform: {
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
sourceMaps: true,
jsc: {
transform: {
react: {
runtime: 'automatic',
},
},
},
},
],
'\\.(svg)$': 'jest-transformer-svg',
'\\.(png)$': 'jest-transform-stub',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@logto/app-insights/(.*)$': '<rootDir>/../app-insights/lib/$1',
'^@logto/shared/(.*)$': '<rootDir>/../shared/lib/$1',
'\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
},
transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto|@silverhand))/)'],
};
export default config;