mirror of
https://github.com/callumalpass/tasknotes.git
synced 2026-07-22 12:50:26 +00:00
This commit addresses a series of cascading test failures to ensure the entire test suite passes, enhancing codebase stability.
The primary changes include:
1. **Fix `MigrationService` Error Handling:**
- Refactored `performMigration` to correctly catch and handle promise rejections occurring within the `migrateFile` function.
- Corrected flawed mocks for `app.fileManager.processFrontMatter` in unit and integration tests to accurately simulate asynchronous error propagation.
2. **Resolve `TaskService` Test Failures:**
- Fixed `task-service-completion.test.ts` by providing a proper mock for `TaskNotesPlugin`, ensuring `getTaskInfo` returns valid recurring task objects.
- Corrected test logic to pass `TaskInfo` objects instead of raw IDs to service methods, aligning with the required function signatures.
- Fixed a `ReferenceError` in a test case by using the correct variable.
3. **Correct UI and Utility Code:**
- Replaced the browser `confirm()` dialog in `FilterBar.ts` with the plugin custom `ConfirmationModal` to prevent breaking tests in a non-browser environment.
- Removed an unnecessary, inferable type declaration in `dateUtils.ts` that was causing a type-checking error.
- Added `"DOM.Iterable"` to the `lib` array in `tsconfig.json` to resolve a type error during compilation.
31 lines
581 B
JSON
31 lines
581 B
JSON
{
|
|
"compilerOptions": {
|
|
"baseUrl": ".",
|
|
"inlineSourceMap": true,
|
|
"inlineSources": true,
|
|
"module": "ESNext",
|
|
"target": "ES6",
|
|
"allowJs": true,
|
|
"noImplicitAny": true,
|
|
"moduleResolution": "node",
|
|
"importHelpers": true,
|
|
"isolatedModules": true,
|
|
"strictNullChecks": true,
|
|
"esModuleInterop": true,
|
|
"allowSyntheticDefaultImports": true,
|
|
"lib": [
|
|
"DOM",
|
|
"DOM.Iterable",
|
|
"ES5",
|
|
"ES6",
|
|
"ES7"
|
|
]
|
|
},
|
|
"include": [
|
|
"src/**/*.ts"
|
|
],
|
|
"exclude": [
|
|
"tests/**/*",
|
|
"node_modules/**/*"
|
|
]
|
|
}
|