Pester unit tests for
ConvertTo-SharpDown. Ported from the legacy Test-SharpDown.ps1 smoke harness.
The temp-path helpers live in BeforeAll because Pester 5 only exposes functions defined there to the It blocks at run time. Top-level function definitions run during discovery and vanish.
function New-TempLeafPath
function New-TempWorkspace
Single-file conversion of C# sources.
Cases
Describe 'CSharp file mode'
//// marker and fences the declaration lines.It 'Strips //// markers and fences declaration lines'
It 'Skips lines that are neither markers nor declarations'
It 'Throws when File path is not a file'
-OutPath points at an existing directory.It 'Throws when File OutPath points to an existing directory'
It 'Warns when source has no SharpDown content'
Per-language markers, fences, and the -API switch.
Cases
Describe 'Language configs'
---- marker fences CREATE statements.It 'Sql marker ---- fences CREATE statements'
#### marker fences function declarations.It 'PowerShell marker #### fences function declarations'
//// marker fences export class declarations.It 'JavaScript marker //// fences export class declarations'
-API suppresses every auto-generated declaration fence.It '-API suppresses all auto-generated declaration fences'
It 'JavaScript drops interior const/let locals but keeps top-level function and type declarations'
Recursive tree walking, mirroring, and pipeline input.
Cases
Describe 'Directory mode'
-Recurse path is not a directory.It 'Throws when -Recurse path is not a directory'
-OutPath points at an existing file.It 'Throws when -Recurse OutPath points to an existing file'
-Recurse, a directory path throws as not-a-file.It 'Without -Recurse, a directory path throws as not-a-file'
src/ and project-name legs.It 'Mirrors tree, strips src/ and project name legs'
DirectoryInfo as -Path under -Recurse.It 'Accepts a piped DirectoryInfo as -Path under -Recurse'
It 'Processes multiple directories piped into a single invocation'
It 'Warns when directory has no matching extensions'