Skip to content

[Property grid]: migrate to vitest#1639

Merged
saskliutas merged 13 commits intomasterfrom
JonasD/property-grid-vitest
Apr 10, 2026
Merged

[Property grid]: migrate to vitest#1639
saskliutas merged 13 commits intomasterfrom
JonasD/property-grid-vitest

Conversation

@JonasDov
Copy link
Copy Markdown
Contributor

Removed mocha and sinon in favor of vitest, similar to #1635

@JonasDov JonasDov requested review from a team as code owners March 31, 2026 07:06
Copilot AI review requested due to automatic review settings March 31, 2026 07:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.ts and migrated test bootstrapping to Vitest lifecycle hooks.
  • Replaced Sinon stubs/spies and Chai assertions with vi mocks/spies and Vitest expect matchers 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.

Comment thread packages/itwin/property-grid/package.json
Comment thread packages/itwin/property-grid/package.json Outdated
Comment thread packages/itwin/property-grid/vitest.config.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread packages/itwin/property-grid/src/test/setup.ts
@saskliutas saskliutas disabled auto-merge April 10, 2026 07:45
@saskliutas saskliutas merged commit 825132e into master Apr 10, 2026
17 of 18 checks passed
@saskliutas saskliutas deleted the JonasD/property-grid-vitest branch April 10, 2026 07:45
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.

3 participants