0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

fix(ui): relocate svg jest config (#856)

relocate svg jest config
This commit is contained in:
simeng-li 2022-05-17 16:32:02 +08:00 committed by GitHub
parent ef19fb3d27
commit d8c62c14a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 7 deletions

View file

@ -6,7 +6,6 @@ const baseConfig: Config.InitialOptions = Object.freeze({
transform: { transform: {
// Enable JS/JSX transformation // Enable JS/JSX transformation
'\\.(t|j)sx?$': 'ts-jest', '\\.(t|j)sx?$': 'ts-jest',
'\\.(svg)$': 'jest-transformer-svg',
}, },
transformIgnorePatterns: [ transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\]((?!ky[/\\\\]).)+\\.(js|jsx|mjs|cjs|ts|tsx)$', '[/\\\\]node_modules[/\\\\]((?!ky[/\\\\]).)+\\.(js|jsx|mjs|cjs|ts|tsx)$',

View file

@ -27,7 +27,6 @@
"@types/node": "16", "@types/node": "16",
"eslint": "^8.10.0", "eslint": "^8.10.0",
"jest": "^27.5.1", "jest": "^27.5.1",
"jest-transformer-svg": "^1.0.2",
"lint-staged": "^12.0.0", "lint-staged": "^12.0.0",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"ts-node": "^10.0.0", "ts-node": "^10.0.0",

View file

@ -3,6 +3,9 @@ import { merge, Config } from '@logto/jest-config';
const config: Config.InitialOptions = merge({ const config: Config.InitialOptions = merge({
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'], setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
transform: {
'\\.(svg)$': 'jest-transformer-svg',
},
}); });
export default config; export default config;

View file

@ -40,6 +40,7 @@
"i18next": "^21.6.12", "i18next": "^21.6.12",
"i18next-browser-languagedetector": "^6.1.3", "i18next-browser-languagedetector": "^6.1.3",
"jest": "^27.5.1", "jest": "^27.5.1",
"jest-transformer-svg": "^1.0.2",
"js-base64": "^3.7.2", "js-base64": "^3.7.2",
"ky": "^0.30.0", "ky": "^0.30.0",
"libphonenumber-js": "^1.9.49", "libphonenumber-js": "^1.9.49",
@ -49,6 +50,7 @@
"postcss-modules": "^4.3.0", "postcss-modules": "^4.3.0",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"react": "^17.0.2", "react": "^17.0.2",
"react-device-detect": "^2.2.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-i18next": "^11.15.4", "react-i18next": "^11.15.4",
"react-modal": "^3.14.4", "react-modal": "^3.14.4",
@ -58,7 +60,6 @@
"react-timer-hook": "^3.0.5", "react-timer-hook": "^3.0.5",
"stylelint": "^13.13.1", "stylelint": "^13.13.1",
"typescript": "^4.6.2", "typescript": "^4.6.2",
"react-device-detect": "^2.2.2",
"use-debounced-loader": "^0.1.1" "use-debounced-loader": "^0.1.1"
}, },
"alias": { "alias": {

View file

@ -734,7 +734,6 @@ importers:
jest: ^27.5.1 jest: ^27.5.1
jest-matcher-specific-error: ^1.0.0 jest-matcher-specific-error: ^1.0.0
jest-transform-stub: ^2.0.0 jest-transform-stub: ^2.0.0
jest-transformer-svg: ^1.0.2
lint-staged: ^12.0.0 lint-staged: ^12.0.0
prettier: ^2.3.2 prettier: ^2.3.2
ts-jest: ^27.1.1 ts-jest: ^27.1.1
@ -753,7 +752,6 @@ importers:
'@types/node': 16.11.12 '@types/node': 16.11.12
eslint: 8.10.0 eslint: 8.10.0
jest: 27.5.1_ts-node@10.7.0 jest: 27.5.1_ts-node@10.7.0
jest-transformer-svg: 1.0.2_jest@27.5.1
lint-staged: 12.4.0 lint-staged: 12.4.0
prettier: 2.5.1 prettier: 2.5.1
ts-node: 10.7.0_42uktnex6oapjbpw2i7vzvmrzi ts-node: 10.7.0_42uktnex6oapjbpw2i7vzvmrzi
@ -863,6 +861,7 @@ importers:
i18next: ^21.6.12 i18next: ^21.6.12
i18next-browser-languagedetector: ^6.1.3 i18next-browser-languagedetector: ^6.1.3
jest: ^27.5.1 jest: ^27.5.1
jest-transformer-svg: ^1.0.2
js-base64: ^3.7.2 js-base64: ^3.7.2
ky: ^0.30.0 ky: ^0.30.0
libphonenumber-js: ^1.9.49 libphonenumber-js: ^1.9.49
@ -908,6 +907,7 @@ importers:
i18next: 21.6.12 i18next: 21.6.12
i18next-browser-languagedetector: 6.1.3 i18next-browser-languagedetector: 6.1.3
jest: 27.5.1 jest: 27.5.1
jest-transformer-svg: 1.0.2_jest@27.5.1+react@17.0.2
js-base64: 3.7.2 js-base64: 3.7.2
ky: 0.30.0 ky: 0.30.0
libphonenumber-js: 1.9.49 libphonenumber-js: 1.9.49
@ -12672,13 +12672,14 @@ packages:
resolution: {integrity: sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==} resolution: {integrity: sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==}
dev: false dev: false
/jest-transformer-svg/1.0.2_jest@27.5.1: /jest-transformer-svg/1.0.2_jest@27.5.1+react@17.0.2:
resolution: {integrity: sha512-A9z5Vzs+TlPpxekwUOCyVu5sHgcCKUKyJTE1q/bUhtAILpgf3kIj6IjguQrTJG0jN0nRnuNV7ckPUE8Vdf12Jg==} resolution: {integrity: sha512-A9z5Vzs+TlPpxekwUOCyVu5sHgcCKUKyJTE1q/bUhtAILpgf3kIj6IjguQrTJG0jN0nRnuNV7ckPUE8Vdf12Jg==}
peerDependencies: peerDependencies:
jest: ^27.0.6 jest: ^27.0.6
react: ^17.0.2 react: ^17.0.2
dependencies: dependencies:
jest: 27.5.1_ts-node@10.7.0 jest: 27.5.1
react: 17.0.2
dev: true dev: true
/jest-util/27.5.1: /jest-util/27.5.1: