Skip to content

test(element): migrate element-ng to vitest part 3#1707

Merged
spike-rabbit merged 1 commit intomainfrom
test/vitest-part-f
Mar 20, 2026
Merged

test(element): migrate element-ng to vitest part 3#1707
spike-rabbit merged 1 commit intomainfrom
test/vitest-part-f

Conversation

@spliffone
Copy link
Member

@spliffone spliffone commented Mar 20, 2026

@spliffone spliffone requested review from a team as code owners March 20, 2026 19:13
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request primarily focuses on migrating test files from Jasmine to Vitest, involving extensive changes across multiple Angular components. The migration includes replacing Jasmine's spyOn, createSpy, clock().install(), clock().tick(), and clock().uninstall() with Vitest's vi.spyOn, vi.fn(), vi.useFakeTimers(), vi.advanceTimersByTime(), and vi.useRealTimers() respectively. Additionally, expect().toHaveSize() is updated to expect().toHaveLength() for array size assertions. Configuration files like angular.json, tsconfig.spec.json, and tsconfig.vitest.json were updated to correctly include or exclude test files based on the new Vitest naming conventions. Several test setups were simplified by removing unnecessary imports and dependencies, such as TestHostComponent, SiFormlyNumberComponent, FormlyTestComponent, ReactiveFormsModule, SiDatepickerModule, and runOnPushChangeDetection. The SiFormlyComponent test setup was refactored to use signal-based inputs directly, eliminating the need for a wrapper component. Type safety was improved by replacing jasmine.Spy with Mock from Vitest and adding a type definition for translateSync in SiTranslateService mock.

Copy link
Member

@spike-rabbit spike-rabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@spike-rabbit spike-rabbit added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 6823da4 Mar 20, 2026
11 checks passed
@spike-rabbit spike-rabbit deleted the test/vitest-part-f branch March 20, 2026 19:58
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