Files
workavia-calendar-front/jest.config.ts
T
Camille Moussu 478a0e0eb0 405 back reload token with synctokens (#436)
* [#405] added syncToken in calendar params and fetch with sync token

* [#405] changed reload to work with sync-token

* [#405] fixup promise handling, added calendar adding and removing hanlding with refresh

* [#405]  fixed event expansion calls

* [#405 & refactor] added helperfunction to get base event uid + refactored synctoken updates management

* [#405] added pMap lib to process event expansion

* [#405] added flag for no synctoken / new synctoken
2026-01-13 11:06:34 +01:00

75 lines
2.0 KiB
TypeScript

import type { Config } from "jest";
// Set timezone to UTC for consistent test results across all environments
process.env.TZ = "UTC";
const config: Config = {
collectCoverage: true,
coverageDirectory: "coverage",
projects: [
{
displayName: "dom",
clearMocks: true,
moduleFileExtensions: [
"js",
"mjs",
"cjs",
"jsx",
"ts",
"tsx",
"json",
"node",
],
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",
},
transformIgnorePatterns: [
"/node_modules/(?!(preact|@fullcalendar|react-calendar|get-user-locale|memoize|mimic-function|@wojtekmaj|ky|cozy-ui|p-map)/)",
],
moduleNameMapper: {
"^preact(/(.*)|$)": "preact$1",
"^react$": "<rootDir>/node_modules/react",
"^react-dom$": "<rootDir>/node_modules/react-dom",
},
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
},
{
displayName: "node",
clearMocks: true,
moduleFileExtensions: [
"js",
"mjs",
"cjs",
"jsx",
"ts",
"tsx",
"json",
"node",
],
testEnvironment: "node",
testMatch: ["**/*.test.ts"],
testTimeout: 15000,
transform: {
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.json" }],
"^.+\\.(js|jsx|mjs)$": "babel-jest",
},
transformIgnorePatterns: ["/node_modules/(?!(ky)/)"],
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
},
],
};
export default config;