[Property grid]: migrate to vitest#1639
Merged
saskliutas merged 13 commits intomasterfrom Apr 10, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the property-grid package’s unit tests from Mocha/Sinon/Chai to Vitest, aligning it with the approach used in similar packages/PRs in this repo.
Changes:
- Added a
vitest.config.tsand migrated test bootstrapping to Vitest lifecycle hooks. - Replaced Sinon stubs/spies and Chai assertions with
vimocks/spies and Vitestexpectmatchers across the test suite. - Updated package test script and dependency lockfile to include Vitest and remove direct Sinon/Chai deps.
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/itwin/property-grid/vitest.config.ts | Introduces Vitest configuration (jsdom env, console filtering, deps inlining, coverage settings). |
| packages/itwin/property-grid/src/test/TestUtils.tsx | Converts shared test helpers from Sinon stubs to vi.fn() / vi.spyOn(). |
| packages/itwin/property-grid/src/test/setup.ts | Replaces Mocha hooks + jsdom setup with Vitest hooks and global stubs. |
| packages/itwin/property-grid/src/test/PropertyGridUiItemsProvider.test.tsx | Migrates assertions/mocking to Vitest APIs. |
| packages/itwin/property-grid/src/test/PropertyGridManager.test.ts | Migrates assertions/mocking to Vitest APIs. |
| packages/itwin/property-grid/src/test/hooks/* | Migrates hook tests to Vitest APIs and updated mock behavior. |
| packages/itwin/property-grid/src/test/components/* | Migrates component tests to Vitest APIs. |
| packages/itwin/property-grid/src/test/api/PreferencesStorage.test.ts | Migrates API unit tests to Vitest APIs. |
| packages/itwin/property-grid/package.json | Switches test script to vitest run; updates devDependencies. |
| packages/itwin/property-grid/pnpm-lock.yaml | Reflects dependency changes (Vitest, removals of direct Sinon/Chai deps, etc.). |
| .gitignore | Ignores *.tsbuildinfo. |
Files not reviewed (1)
- packages/itwin/property-grid/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 26 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- packages/itwin/property-grid/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
saskliutas
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed mocha and sinon in favor of vitest, similar to #1635