Skip to content

Commit ef1063c

Browse files
committed
Implement DatePickerSingle
1 parent 0fab9a1 commit ef1063c

37 files changed

+6371
-214
lines changed
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
module.exports = {
22
preset: 'ts-jest',
3-
testEnvironment: 'node',
3+
testEnvironment: 'jsdom',
44
roots: ['<rootDir>/tests'],
5-
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
5+
testMatch: ['**/__tests__/**/*.{ts,tsx}', '**/?(*.)+(spec|test).{ts,tsx}'],
66
transform: {
7-
'^.+\\.ts$': 'ts-jest',
7+
'^.+\\.(ts|tsx)$': ['ts-jest', {
8+
tsconfig: {
9+
jsx: 'react',
10+
esModuleInterop: true,
11+
allowSyntheticDefaultImports: true,
12+
types: ['jest', '@testing-library/jest-dom'],
13+
},
14+
}],
15+
'^.+\\.js$': ['ts-jest', {
16+
tsconfig: {
17+
allowJs: true,
18+
},
19+
}],
820
},
921
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'],
1022
moduleNameMapper: {
1123
'^@/(.*)$': '<rootDir>/src/$1',
24+
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
1225
},
1326
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
27+
// Disable caching to ensure TypeScript type changes are always picked up
28+
cache: false,
1429
};
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
// Jest setup file
2-
// This file is loaded before every test file
2+
// This file is loaded before every test file
3+
import '@testing-library/jest-dom';
4+
5+
// Mock window.dash_component_api for components that use Dash context
6+
global.window = global.window || {};
7+
global.window.dash_component_api = {
8+
useDashContext: () => ({
9+
useLoading: () => false,
10+
}),
11+
};

0 commit comments

Comments
 (0)