Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

The automated Vitest migration schematic left several compatibility issues that caused CI compilation failures.

Changes

  • Vitest API migration

    • Added missing expect import to test utilities
    • Replaced jasmine.getEnv().beforeEach/afterEach with Vitest's top-level hooks
    • Replaced jasmine.createSpyObj with manual mock objects using vi.fn()
    • Replaced pending() with it.skip() for skipped tests
  • Assertion syntax

    • Moved custom error messages before matchers: expect(value, 'message').toBe(expected) instead of expect(value).toBe(expected, 'message')
  • Type corrections

    • Replaced string literals with proper enums: GridPagingMode.Remote, GridSelectionMode.none, GridColumnDataType.*
    • Added missing component properties referenced in templates (isEditable, isHidden, isGroupable, paging)
  • Deprecated API cleanup

    • Removed deprecated grid properties: exportExcel, exportCsv, moveable
    • Fixed mock emitter types using any for TypeScript compatibility

Example

// Before - Jasmine API
(jasmine.getEnv() as any).beforeEach(() => { /* ... */ });
const spy = jasmine.createSpyObj<T>(methods);
expect(value).toBe(expected, 'error message');

// After - Vitest API
beforeEach(() => { /* ... */ });
const spy: any = { method: vi.fn() };
expect(value, 'error message').toBe(expected);

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 21, 2026 17:24
- Add expect import to calendar-helper-utils.ts
- Replace jasmine.getEnv() with vitest beforeEach/afterEach
- Replace jasmine.createSpyObj with vi.fn() based mocks
- Replace pending() with it.skip()
- Fix expect() message syntax for vitest (message before assertion)
- Remove deprecated exportExcel and exportCsv properties
- Remove deprecated moveable property from column definitions
- Fix mock emitter types to use any for compatibility

Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
- Add GridPagingMode import and use GridPagingMode.Remote for RemotePagingComponent
- Add GridSelectionMode import and use GridSelectionMode.none for MovableColumnsComponent
- Add GridColumnDataType import and properly type columns in IgxGridAdvancedFilteringDynamicColumnsComponent

Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
- Add isEditable, isHidden, isGroupable to MovableTemplatedColumnsComponent
- Add paging property to MovableColumnsLargeComponent

Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor tests by moving to vitest in initial commit fix(tests): Complete Vitest migration fixes for CI compilation errors Jan 21, 2026
Copilot AI requested a review from ChronosSF January 21, 2026 17:33
@ChronosSF ChronosSF marked this pull request as ready for review January 21, 2026 21:09
@ChronosSF ChronosSF merged commit 79659a9 into sstoychev/migrate-vitest Jan 21, 2026
@ChronosSF ChronosSF deleted the copilot/sub-pr-16781 branch January 21, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants