Skip to content

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Jan 18, 2026

Introduce the Update-ProjectRecent function to improve recent project updates handling. Refactor test cases to streamline mock handling and remove redundant code. Add new functions for better test management and ensure accurate date retrieval with Mock_Today. This update also includes unit tests for the new functionality.

  • feat(project): add Update-ProjectRecent function to manage recent project updates

  • refactor(test): update global variable handling for TestName

  • feat(mock): add Mock_Today function to retrieve today's date

  • fix(test): comment out Enable-InvokeCommandAliasModule in Test_FindProject_SUCCESS

  • feat(includeFiles): add functions to run before and after tests

  • fix(project): correct query assignment in Update-ProjectRecent function

  • fix(test): remove commented Enable-InvokeCommandAliasModule commented code in Test_FindProject_SUCCESS function

  • fix(mock): update date values in Get-Mock_Today function

  • test(project): add unit tests for Update-ProjectRecent functionality

  • refactor(test): replace MockCall_GitHubOrgProjectWithFields with MockCall_GetProject_700 in test files

  • feat(test): add Reset_Test_Mock function and integrate it in Run_BeforeEach

  • refactor(copilot): streamline Arrange phase in Test_AddProjectUser functions

  • refactor(test): remove redundant mock resets from test cases and use Run_BeforeEach to set standard mock arrange

@@ -0,0 +1,48 @@
function Update-ProjectRecent{

Check warning

Code scanning / PSScriptAnalyzer

Function 'Update-ProjectRecent' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Update-ProjectRecent' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
return $ret
} Export-ModuleMember -Function Update-ProjectRecent

function Set-EnvItem_Last_RecentUpdate_Today{

Check warning

Code scanning / PSScriptAnalyzer

Function 'Set-EnvItem_Last_RecentUpdate_Today' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Set-EnvItem_Last_RecentUpdate_Today' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
Invoke-TestingHelper -ShowTestErrors:$ShowTestErrors
}
# Resolve scoped tests
$TestName = [string]::IsNullOrWhiteSpace($TestName) ? $global:TestNameVar : $TestName

Check warning

Code scanning / PSScriptAnalyzer

Found global variable 'global:TestNameVar'. Warning test

Found global variable 'global:TestNameVar'.
@@ -0,0 +1,28 @@
# Run Before and After any test
#

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

function Test_UpdateProjectRecent_UpdateBasedOn_SetRecentUpdate{
# Arrange

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

# Cache project
MockCall_GetProject_700 -Cache

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
@@ -0,0 +1,48 @@
function Update-ProjectRecent{

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Update-ProjectRecent' does not have a help comment. Note

The cmdlet 'Update-ProjectRecent' does not have a help comment.
@rulasg rulasg merged commit f4384b2 into main Jan 19, 2026
3 checks passed
@rulasg rulasg deleted the update-project-recent branch January 19, 2026 15:41
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