Skip to content

Conversation

@flanakin
Copy link
Collaborator

πŸ› οΈ Description

Fix mocking issue with unit tests

πŸ“‹ Checklist

πŸ”¬ How did you test this change?

  • 🀏 Lint tests
  • 🀞 PS -WhatIf / az validate
  • πŸ‘ Manually deployed + verified
  • πŸ’ͺ Unit tests
  • πŸ™Œ Integration tests

πŸ™‹β€β™€οΈ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🀏 The change is less than 20 lines of code.

πŸ“‘ Did you update docs/changelog.md?

  • βœ… Updated changelog (required for dev PRs)
  • ➑️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

πŸ“– Did you update documentation?

  • βœ… Public docs in docs (required for dev)
  • βœ… Public docs in docs-mslearn (required for dev)
  • βœ… Internal dev docs in docs-wiki (required for dev)
  • βœ… Internal dev docs in src (required for dev)
  • ➑️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

Copilot AI review requested due to automatic review settings February 11, 2026 10:26
@microsoft-github-policy-service microsoft-github-policy-service bot added Micro PR πŸ”¬ Very small PR that should be especially easy for newcomers Needs: Review πŸ‘€ PR that is ready to be reviewed labels Feb 11, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added the Tool: PowerShell PowerShell scripts and automation label Feb 11, 2026
Copy link
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 fixes PowerShell unit test mocking issues that were causing test failures. The changes ensure test assertions properly match the production code behavior and that all necessary functions are mocked correctly.

Changes:

  • Updated New-FinOpsCostExport unit tests to apply .Trim('/') in assertions to match production code behavior
  • Added parameter declarations to the New-AzResourceGroupDeployment stub function to enable proper parameter validation in tests
  • Added missing mock for Initialize-FinOpsHubDeployment in the Deploy-FinOpsHub 'Old tests' context

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/powershell/Tests/Unit/New-FinOpsCostExport.Tests.ps1 Updated test assertions to include .Trim('/') to match the rootFolderPath trimming behavior in the production code
src/powershell/Tests/Unit/Deploy-FinOpsHub.Tests.ps1 Added parameter declarations to stub function and added missing Initialize-FinOpsHubDeployment mock to prevent test failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Micro PR πŸ”¬ Very small PR that should be especially easy for newcomers Needs: Review πŸ‘€ PR that is ready to be reviewed Tool: PowerShell PowerShell scripts and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants