Skip to content
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

Move temp-file deletion for integration tests to Bootstrap #125

Merged
merged 2 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Tests/Integration/Bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ $test = @{
if (Get-Module -Name "TestModule") {
Remove-Module -Name "TestModule" -Force -Verbose:$False
}

# remove any previous folders in $env:Temp
if ((Get-Module Alt3.Docusaurus.PowerShell) -and (Test-Path -Path $test.TempFolder)) {
Remove-Item $test.TempFolder -Recurse -Force
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,3 @@ Describe "Integration Test to ensure all supported Code Example variants render
$generatedMdx | Should -BeExactly $expectedMdx
}
}

AfterAll {
if (Get-Module Alt3.Docusaurus.PowerShell) {
# Remove-Item $test.TempFolder -Recurse -Force
}
}
2 changes: 1 addition & 1 deletion Tests/Integration/CrossVersionCodeExamples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ This test assures:

- That various `Get-Help` examples render identically on **all** PowerShell versions

Additional information:
## Additional information:

- Logic described at https://github.com/alt3/Docusaurus.PowerShell/issues/14#issuecomment-568552556
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,3 @@ Describe "Integration Test to ensure all supported Code Example variants render
$generatedMdx | Should -BeExactly $expectedMdx
}
}

AfterAll {
if (Get-Module Alt3.Docusaurus.PowerShell) {
# Remove-Item $test.TempFolder -Recurse -Force
}
}
4 changes: 3 additions & 1 deletion Tests/Integration/IndentLineWithOpeningBracket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This test ensures that this function:
- By comparing indentation of the line below
- And recalculating indentation if things are amiss

## Why?

Required because PlatyPS sometimes gets things wrong when parsing complex code
examples like the example below where the line with `It` should have been indented.

Expand Down Expand Up @@ -40,7 +42,7 @@ examples like the example below where the line with `It` should have been indent

```

Addtional information:
## Additional information:

- https://github.com/pester/Pester/issues/2195
- Link to regex in function [source file](https://github.com/alt3/Docusaurus.PowerShell/blob/main/Source/Private/IndentLineWithOpeningBracket.ps1#L17)
6 changes: 0 additions & 6 deletions Tests/Integration/PlaceholderExamples/Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,3 @@ Describe "Integration Test for PlatyPS generated placeholder examples" {
$generatedMdxWithoutPlaceholders | Should -BeExactly $expectedMdxWithoutPlaceholders
}
}

AfterAll {
if (Get-Module Alt3.Docusaurus.PowerShell) {
Remove-Item $test.TempFolder -Recurse -Force
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,3 @@ Describe "Integration Test to ensure PowerShell 7 Native Multi-Line Code Example
$generatedMdx | Should -BeExactly $expectedMdx
}
}

AfterAll {
if (Get-Module Alt3.Docusaurus.PowerShell) {
Remove-Item $test.TempFolder -Recurse -Force
}
}
2 changes: 1 addition & 1 deletion Tests/Integration/PowerShell7NativeMultiLineCode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This test ensures:

- That PowerShell 7 "native multi-line code examples" render as expected

Additional information:
## Additional information:

- https://docusaurus-powershell.netlify.app/docs/faq/multi-line-examples#powershell-7-native-multi-lines
- https://github.com/PowerShell/platyPS/issues/180#issuecomment-568877700
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,3 @@ Describe "Integration Test to ensure all supported Code Example variants render
$generatedMdx | Should -BeExactly $expectedMdx
}
}

AfterAll {
if (Get-Module Alt3.Docusaurus.PowerShell) {
# Remove-Item $test.TempFolder -Recurse -Force
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This test ensures that this function:

- Removes blank line(s) below lines ending with an opening curly bracket

## Why?

Required because PlatyPS sometimes gets things wrong when parsing complex code
examples like the example below:

Expand All @@ -16,6 +18,6 @@ examples like the example below:
```
```

Addtional information:
## Additional information:

- Link to regex in function [source file](https://github.com/alt3/Docusaurus.PowerShell/blob/main/Source/Private/RemoveEmptyLinesBelowOpeningBracket.ps1#L10)
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,3 @@ Describe "Integration Test to ensure all supported Code Example variants render
$generatedMdx | Should -BeExactly $expectedMdx
}
}

AfterAll {
if (Get-Module Alt3.Docusaurus.PowerShell) {
# Remove-Item $test.TempFolder -Recurse -Force
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This test ensures that this function:

- Removes blank line(s) below lines ending with an opening curly bracket

## Why?

Required because PlatyPS sometimes gets things wrong when parsing complex code
examples like the example below:

Expand All @@ -16,6 +18,6 @@ examples like the example below:
```
```

Addtional information:
## Additional information:

- Link to regex in function [source file](https://github.com/alt3/Docusaurus.PowerShell/blob/main/Source/Private/RemoveEmptyLinesBelowOpeningBracket.ps1#L10)
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,3 @@ Describe "Integration Test to ensure PowerShell 7 Native Multi-Line Code Example
}
}

AfterAll {
if (Get-Module Alt3.Docusaurus.PowerShell) {
# Remove-Item $test.TempFolder -Recurse -Force
}
}
2 changes: 1 addition & 1 deletion Tests/Integration/SeparateMarkdownHeadings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This test ensures that this function:
- Only matches valid markdown headings (and thus with no blank line beneath them)
- Inserts a blank line beneath those heading matches

Additional information:
## Additional information:

- [Markdownlint rule MD022](https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md022---headers-should-be-surrounded-by-blank-lines)
- Link to regex in function [source file](https://github.com/alt3/Docusaurus.PowerShell/blob/main/Source/Private/SeparateMarkdownHeadings.ps1#L12)