* #708 apply strictier linting rules and fix simple eslint bugs * #708 fix eslint errors relate to promise * #708 fix eslint import/no-extraneous-dependencies * #708 fix eslint errors of react-hook * #708 enable eslint check for typescript --------- Co-authored-by: lethemanh <lethemanh@lethemanhs-MacBook-Pro.local>
This commit is contained in:
+49
-49
@@ -1,78 +1,78 @@
|
||||
import type { Config } from "jest";
|
||||
import type { Config } from 'jest'
|
||||
|
||||
// Set timezone to UTC for consistent test results across all environments
|
||||
process.env.TZ = "UTC";
|
||||
process.env.TZ = 'UTC'
|
||||
|
||||
const config: Config = {
|
||||
collectCoverage: true,
|
||||
coverageDirectory: "coverage",
|
||||
coverageDirectory: 'coverage',
|
||||
|
||||
projects: [
|
||||
{
|
||||
displayName: "dom",
|
||||
displayName: 'dom',
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: [
|
||||
"js",
|
||||
"mjs",
|
||||
"cjs",
|
||||
"jsx",
|
||||
"ts",
|
||||
"tsx",
|
||||
"json",
|
||||
"node",
|
||||
'js',
|
||||
'mjs',
|
||||
'cjs',
|
||||
'jsx',
|
||||
'ts',
|
||||
'tsx',
|
||||
'json',
|
||||
'node'
|
||||
],
|
||||
testEnvironment: "jsdom",
|
||||
testMatch: ["**/*.test.tsx"],
|
||||
testEnvironment: 'jsdom',
|
||||
testMatch: ['**/*.test.tsx'],
|
||||
testTimeout: 15000,
|
||||
transform: {
|
||||
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.json" }],
|
||||
"^.+\\.(js|jsx|mjs)$": "babel-jest",
|
||||
"^.+\\.(css|scss|sass|less|styl|stylus)$":
|
||||
"jest-preview/transforms/css",
|
||||
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)":
|
||||
"jest-preview/transforms/file",
|
||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
|
||||
"<rootDir>/fileTransformer.ts",
|
||||
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
|
||||
'^.+\\.(js|jsx|mjs)$': 'babel-jest',
|
||||
'^.+\\.(css|scss|sass|less|styl|stylus)$':
|
||||
'jest-preview/transforms/css',
|
||||
'^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)':
|
||||
'jest-preview/transforms/file',
|
||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||
'<rootDir>/fileTransformer.ts'
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
"/node_modules/(?!(preact|@fullcalendar|react-calendar|get-user-locale|memoize|mimic-function|@wojtekmaj|ky|cozy-ui|p-map|@linagora/twake-mui|@lottiefiles)/)",
|
||||
'/node_modules/(?!(preact|@fullcalendar|react-calendar|get-user-locale|memoize|mimic-function|@wojtekmaj|ky|cozy-ui|p-map|@linagora/twake-mui|@lottiefiles)/)'
|
||||
],
|
||||
|
||||
moduleNameMapper: {
|
||||
"^preact(/(.*)|$)": "preact$1",
|
||||
"^react$": "<rootDir>/node_modules/react",
|
||||
"^react-dom$": "<rootDir>/node_modules/react-dom",
|
||||
"^@/(.*)$": "<rootDir>/src/$1",
|
||||
'^preact(/(.*)|$)': 'preact$1',
|
||||
'^react$': '<rootDir>/node_modules/react',
|
||||
'^react-dom$': '<rootDir>/node_modules/react-dom',
|
||||
'^@/(.*)$': '<rootDir>/src/$1'
|
||||
},
|
||||
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
|
||||
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts']
|
||||
},
|
||||
{
|
||||
displayName: "node",
|
||||
displayName: 'node',
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: [
|
||||
"js",
|
||||
"mjs",
|
||||
"cjs",
|
||||
"jsx",
|
||||
"ts",
|
||||
"tsx",
|
||||
"json",
|
||||
"node",
|
||||
'js',
|
||||
'mjs',
|
||||
'cjs',
|
||||
'jsx',
|
||||
'ts',
|
||||
'tsx',
|
||||
'json',
|
||||
'node'
|
||||
],
|
||||
testEnvironment: "node",
|
||||
testMatch: ["**/*.test.ts"],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testTimeout: 15000,
|
||||
transform: {
|
||||
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.json" }],
|
||||
"^.+\\.(js|jsx|mjs)$": "babel-jest",
|
||||
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.json' }],
|
||||
'^.+\\.(js|jsx|mjs)$': 'babel-jest'
|
||||
},
|
||||
transformIgnorePatterns: ["/node_modules/(?!(ky|@linagora/twake-mui)/)"],
|
||||
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
|
||||
transformIgnorePatterns: ['/node_modules/(?!(ky|@linagora/twake-mui)/)'],
|
||||
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
|
||||
moduleNameMapper: {
|
||||
"^@/(.*)$": "<rootDir>/src/$1",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
'^@/(.*)$': '<rootDir>/src/$1'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export default config;
|
||||
export default config
|
||||
|
||||
Reference in New Issue
Block a user