Skip to content

Commit

Permalink
Rename test helper function to Clear-Project.
Browse files Browse the repository at this point in the history
  • Loading branch information
KhoiKy committed Jan 24, 2025
1 parent 0f1c7c3 commit 4532698
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Tests/Get-YTProject.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

Remove-AllProjects -Wait
Clear-Project -Wait

function GivenProject
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Invoke-YTRestMethod.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Describe 'Invoke-YTRestMethod' {
}

It 'should get projects' {
Remove-AllProjects -Wait
Clear-Project -Wait
New-YTProject -Session $script:session -Name 'Invoke-YTRestMethod' -ShortName 'IYTRM' -Leader 'admin'
$project = Invoke-YTRestMethod -Session $script:session -Name 'admin/projects?fields=id,name,shortName'
$project | Should -HaveCount 1
Expand Down
2 changes: 1 addition & 1 deletion Tests/New-YTIssue.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BeforeAll {
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

$script:session = New-YTSession -Url $apiUrl -ApiToken $apiToken
Remove-AllProjects -Wait
Clear-Project -Wait

New-YTProject -Session $script:session -Leader 'admin' -Name 'New-YTIssue' -ShortName 'NYTI' -ErrorAction Stop | Out-Null

Expand Down
2 changes: 1 addition & 1 deletion Tests/New-YTProject.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

Remove-AllProjects -Wait
Clear-Project -Wait

function WhenCreatingProject
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Remove-YTProject.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Describe 'Remove-YTProject' {
}

AfterEach {
Remove-AllProjects -Wait
Clear-Project -Wait
}

It 'should delete project based on short name' {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$apiToken = 'perm:YWRtaW4=.NDctMA==.MskXiizMXwymP1Kfm21iR14len99jp'
$apiUrl = 'http://localhost:8080'

function Remove-AllProjects
function Clear-Project
{
[CmdletBinding()]
param(
Expand Down Expand Up @@ -35,4 +35,4 @@ function Remove-AllProjects
$stopwatch = $stopwatch.Elapsed
}

Export-ModuleMember -Variable 'apiToken', 'apiUrl' -Function 'Remove-AllProjects'
Export-ModuleMember -Variable 'apiToken', 'apiUrl' -Function 'Clear-Project'

0 comments on commit 4532698

Please sign in to comment.