-
Notifications
You must be signed in to change notification settings - Fork 571
SQL Projects test migration and fixes #21179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…t/vscode-mssql into sai/feb/Cleanup_sqlproj
…t/vscode-mssql into sai/feb/Cleanup_sqlproj
…t/vscode-mssql into sai/feb/Cleanup_sqlproj
…d returnign the value from sts instead of hardcoded false
There was a problem hiding this 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 SQL Database Projects extension tests from the should and TypeMoq testing libraries to chai (expect) and sinon.sandbox for mocking. The migration aims to modernize the test infrastructure and improve test maintainability.
Changes:
- Removed
shouldandTypeMoqdependencies from package.json and yarn.lock - Converted all test assertions from
should()toexpect()syntax - Migrated all mocks from
TypeMoq.Mock.ofType()to sinon stubs/spies - Introduced sandbox pattern for sinon to ensure proper cleanup between tests
- Fixed duplicate code in projectController.ts source file
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Removed should and TypeMoq library entries |
| package.json | Removed should and typemoq dev dependencies |
| utils.test.ts | Migrated assertions to chai expect syntax |
| updateProjectFromDatabaseQuickpick.test.ts | Added sandbox pattern and migrated assertions |
| testUtils.ts | Modified shouldThrowSpecificError to use expect and handle Windows path differences |
| testContext.ts | Removed TypeMoq usage, using plain object for dacFxService |
| sqlDatabaseProjectTaskProvider.test.ts | Migrated all should assertions to expect |
| runTest.ts | Improved test runner configuration and comments |
| projectTree.test.ts | Converted all should assertions to expect |
| projectController.test.ts | Large migration with sandbox pattern, contains duplicate test |
| project.test.ts | Migrated all assertions, removed projectSuite conditional |
| newProjectTool.test.ts | Replaced TypeMoq with plain object mocks |
| netCoreTool.test.ts | Added sandbox pattern |
| mainController.test.ts | Migrated assertions and added sandbox |
| dialogTestUtils.ts | Removed TypeMoq, using plain objects |
| datasource.test.ts | Migrated assertions to expect |
| createProjectFromDatabaseQuickpick.test.ts | Added sandbox pattern and migrated assertions |
| autorestHelper.test.ts | Added sandbox and unskipped test |
| projectController.ts | Removed duplicate areEqual check (source code fix) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21179 +/- ##
==========================================
+ Coverage 69.15% 69.18% +0.02%
==========================================
Files 256 256
Lines 25201 25201
Branches 3286 3286
==========================================
+ Hits 17429 17435 +6
+ Misses 7635 7630 -5
+ Partials 137 136 -1 🚀 New features to boost your workflow:
|
Pull Request Template – vscode-mssql
Description
In this PR:
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines