first commit
Some checks failed
Deploy to Aliyun ACR / build-and-push (push) Has been cancelled

This commit is contained in:
jeremygan2021
2026-02-27 17:01:55 +08:00
commit 99218d9035
37 changed files with 15001 additions and 0 deletions

27
jest.config.ts Normal file
View File

@@ -0,0 +1,27 @@
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/src/__mocks__/fileMock.js',
},
transform: {
'^.+\\.tsx?$': ['ts-jest', {
useESM: true,
tsconfig: 'tsconfig.test.json',
diagnostics: {
ignoreCodes: [1343]
},
astTransformers: {
before: [
{
path: 'ts-jest-mock-import-meta',
options: { metaObjectReplacement: { env: { VITE_API_KEY: 'test-key' } } }
}
]
}
}],
},
extensionsToTreatAsEsm: ['.ts', '.tsx'],
};