(fix): add appointment code in requests and profile completion reward (test): add test coverage for multiple pages and components (fix) - Added appointment code to the Requests section (fix) - Added "Claim Gift" feature for completing the profile (test) Added tests for the following pages/components: 1- Active Devices 2- Add Service 3- Appointment Request (cards display section) 4- Create Gift Card 5- Customer List component (used in Quick Booking, Advanced Booking, etc.) 6- Customer List in Customer Club 7- Delete and Edit buttons (used across the entire app) 8- Invoice 9- Create Individual Schedule Table 10- Notification SMS in SMS Center 11- Loyalty Card List 12- Loyal Customers in ResAssistant 13- Map component 14- Staff List in Staff Management 15- Services List (used in General Link, Custom Link, Advanced Booking, etc.) 16- Services List (used in Quick Booking, Gift Card, Discount Center, etc.)
48 lines
2.0 KiB
TypeScript
48 lines
2.0 KiB
TypeScript
import type { Config } from "@jest/types";
|
|
|
|
const config: Config.InitialOptions = {
|
|
preset: "ts-jest",
|
|
testEnvironment: "jsdom",
|
|
roots: ["<rootDir>/src", "<rootDir>/tests"],
|
|
testMatch: [
|
|
"**/__tests__/**/*.+(ts|tsx|js)",
|
|
"**/?(*.)+(spec|test).+(ts|tsx|js)",
|
|
],
|
|
transform: {
|
|
"^.+\\.(ts|tsx)$": "ts-jest",
|
|
"^.+\\.(js|jsx)$": "babel-jest", // optional — اگر babel ندارید میتوانید حذف کنید
|
|
'^.+\\.tsx?$': ['ts-jest', {tsconfig: 'tsconfig.json',}]
|
|
},
|
|
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
|
|
moduleNameMapper: {
|
|
"^@/(.*)$": "<rootDir>/src/$1",
|
|
"^@public/lotties/(.*)$": "<rootDir>/public/lotties/$1",
|
|
"^@package.json$": "<rootDir>/package.json",
|
|
// "^@appointment/(.*)$": "<rootDir>/src/apps/appointment/$1",
|
|
// "^@card/(.*)$": "<rootDir>/src/apps/card/$1",
|
|
"^@new-ui/(.*)$": "<rootDir>/src/apps/new-ui/$1",
|
|
// "^@new-ui-card/(.*)$": "<rootDir>/src/apps/new-ui-card/$1",
|
|
|
|
// static assets & styles
|
|
// "^import.meta.env$": "<rootDir>/__mocks__/importMetaEnvMock.js",
|
|
"^.+\\.(css|scss|sass)$": "<rootDir>/tests/__mocks__/styleMock.js",
|
|
"^@/utils/axios-interceptor$":
|
|
"<rootDir>//__mocks__tests/axios-interceptor.ts",
|
|
"^.+\\.(jpg|jpeg|png|gif|webp|svg)$":
|
|
"<rootDir>/tests/__mocks__/fileMock.js",
|
|
},
|
|
setupFiles: ["<rootDir>/tests/jestSetupFiles.ts"], // اجرا قبل از env
|
|
setupFilesAfterEnv: ["<rootDir>/tests/setupTests.ts"], // اجرا بعد از env
|
|
moduleDirectories: ["node_modules", "src"],
|
|
testPathIgnorePatterns: ["/node_modules/", "/dist/", "/build/"],
|
|
transformIgnorePatterns: ["/node_modules/(?!(some-esm-package)/)"], // اگر نیاز به transpile node_modules دارید آنها را لیست کنید
|
|
collectCoverage: false,
|
|
// globals: {
|
|
// "ts-jest": {
|
|
// tsconfig: "tsconfig.jest.json", // اگر فایل جدا دارید؛ در غیر اینصورت 'tsconfig.json'
|
|
// },
|
|
// },
|
|
};
|
|
|
|
export default config;
|