1- Import-Module - Name Pester - Force
1+ if (-not (Get-Module - Name Pester)) {
2+ Import-Module - Name Pester - Force
3+ }
24Import-Module .\Toggl.API\Toggl.API.psm1 - Force
35
4- $configPath = Join-Path - Path $PSScriptRoot - ChildPath " ..\config.json"
5- $config = Get-Content - Path $configPath | ConvertFrom-Json
6+ Describe ' Reports.Detailed Integration Tests' {
7+ BeforeAll {
8+ $configPath = Join-Path - Path $PSScriptRoot - ChildPath " ..\config.json"
9+ $config = Get-Content - Path $configPath | ConvertFrom-Json
610
7- $apiToken = $config.apiToken
8- $workspaceId = $config.workspaceId
11+ $apiToken = $config.apiToken
12+ $workspaceId = $config.workspaceId
913
10- $startDate = " 2023-01-01"
11- $endDate = " 2023-12-31"
14+ $startDate = " 2023-01-01"
15+ $endDate = " 2023-12-31"
1216
13- Describe ' Reports.Detailed Integration Tests' {
14- BeforeAll {
1517 $timeEntryIds = @ ()
1618 $tagIds = @ ()
1719 $start = [datetime ]::ParseExact(" 2023-01-01" , " yyyy-MM-dd" , $null )
@@ -25,7 +27,7 @@ Describe 'Reports.Detailed Integration Tests' {
2527 - Start $start `
2628 - Description " Test Time Entry 1"
2729
28- $response1 | Should Not BeNullOrEmpty
30+ $response1 | Should - Not - BeNullOrEmpty
2931 $timeEntryIds += $response1.id
3032
3133 # Create second time entry
@@ -36,7 +38,7 @@ Describe 'Reports.Detailed Integration Tests' {
3638 - Start $start `
3739 - Description " Test Time Entry 2"
3840
39- $response2 | Should Not BeNullOrEmpty
41+ $response2 | Should - Not - BeNullOrEmpty
4042 $timeEntryIds += $response2.id
4143
4244 $response3 = New-TogglTimeEntry `
@@ -47,7 +49,7 @@ Describe 'Reports.Detailed Integration Tests' {
4749 - Description " Test Time Entry 3" `
4850 - Tags @ (" tag1" , " tag2" )
4951
50- $response3 | Should Not BeNullOrEmpty
52+ $response3 | Should - Not - BeNullOrEmpty
5153 $timeEntryIds += $response3.id
5254 $tagIds += $response3.tag_ids
5355 }
@@ -71,7 +73,7 @@ Describe 'Reports.Detailed Integration Tests' {
7173 - EndDate $endDate `
7274 - PageSize 10
7375
74- $response | Should Not BeNullOrEmpty
76+ $response | Should - Not - BeNullOrEmpty
7577 $response.GetType ().Name | Should - Be " Object[]"
7678 $response.Count | Should - BeExactly $timeEntryIds.Count
7779
@@ -93,11 +95,11 @@ Describe 'Reports.Detailed Integration Tests' {
9395 - TagIds @ () `
9496 - PageSize 10
9597
96- $response | Should Not BeNullOrEmpty
98+ $response | Should - Not - BeNullOrEmpty
9799 $response.GetType ().Name | Should - Be " Object[]"
98100
99101 $response | ForEach-Object {
100- $_.tags | Should BeNullOrEmpty
102+ $_.tags | Should - BeNullOrEmpty
101103 }
102104 }
103105
@@ -110,7 +112,7 @@ Describe 'Reports.Detailed Integration Tests' {
110112 - TagIds $tagIds `
111113 - PageSize 10
112114
113- $response | Should Not BeNullOrEmpty
115+ $response | Should - Not - BeNullOrEmpty
114116
115117 $response.GetType ().Name | Should - Be " PSCustomObject"
116118
0 commit comments