You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2932cd
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(@schematics/angular): implement type-safe TODO notes in jasmine-to-vitest
This commit refactors the `jasmine-to-vitest` schematic to use a centralized and type-safe system for generating "TODO" comments. Previously, TODO messages were hardcoded strings scattered across various transformer files. This new system improves maintainability, consistency, and developer experience.
Key changes include:
- A new `utils/todo-notes.ts` file acts as a single source of truth for all TODO messages, categories, and optional documentation URLs.
- Advanced mapped types (`TodoCategory`, `TodoContextMap`) are used to infer types directly from the configuration, ensuring that all calls are type-safe and preventing runtime errors.
- The `addTodoComment` helper is now overloaded to handle both static and dynamic (context-aware) messages, ensuring that specific details (like an unsupported function name) are included in the comment.
- All transformers have been updated to use this new system, resulting in cleaner, more consistent, and more maintainable code.
// TODO: vitest-migration: jasmine.addMatchers is not supported. Please manually migrate to expect.extend().
425
+
// TODO: vitest-migration: jasmine.addMatchers is not supported. Please manually migrate to expect.extend(). See: https://vitest.dev/api/expect.html#expect-extend
426
426
jasmine.addMatchers({
427
427
toBeAwesome: () => ({
428
428
compare: (actual) => ({ pass: actual === 'awesome' })
// TODO: vitest-migration: Vitest does not have a direct equivalent for jasmine.spyOnAllFunctions(). Please spy on individual methods manually using vi.spyOn().
440
+
// TODO: vitest-migration: Vitest does not have a direct equivalent for jasmine.spyOnAllFunctions(). Please spy on individual methods manually using vi.spyOn(). See: https://vitest.dev/api/vi.html#vi-spyon
// TODO: vitest-migration: jasmine.addMatchers is not supported. Please manually migrate to expect.extend().
111
+
// TODO: vitest-migration: jasmine.addMatchers is not supported. Please manually migrate to expect.extend(). See: https://vitest.dev/api/expect.html#expect-extend
expected: `// TODO: vitest-migration: jasmine.addCustomEqualityTester is not supported. Please manually migrate to expect.addEqualityTesters().
144
+
expected: `// TODO: vitest-migration: jasmine.addCustomEqualityTester is not supported. Please manually migrate to expect.addEqualityTesters(). See: https://vitest.dev/api/expect.html#expect-addequalitytesters
0 commit comments