From b69c68ef2447cfbd2ffa57386bb85aef624e9816 Mon Sep 17 00:00:00 2001 From: Petri Asikainen Date: Sat, 4 Sep 2021 23:30:52 +0300 Subject: [PATCH] More testing --- Tests/SnipeitPS.Tests.ps1 | 46 +++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/Tests/SnipeitPS.Tests.ps1 b/Tests/SnipeitPS.Tests.ps1 index dcc79f8..bc54c2c 100644 --- a/Tests/SnipeitPS.Tests.ps1 +++ b/Tests/SnipeitPS.Tests.ps1 @@ -109,37 +109,31 @@ Describe "SnipeitPS" { } } - # The CI changes I'm testng now will render this section obsolete, - # as it should automatically patch the module manifest file with all - # exported function names. - # Leaving the code here for the moment while I can ensure those - # features are working correctly. - # - # Context "Function checking" { - # $functionFiles = Get-ChildItem $publicFunctions -Filter *.ps1 | - # Select-Object -ExpandProperty BaseName | - # Where-Object { $_ -notlike "*.Tests" } + Context "Function checking" { + $functionFiles = Get-ChildItem $publicFunctions -Filter *.ps1 | + Select-Object -ExpandProperty BaseName | + Where-Object { $_ -notlike "*.Tests" } - # $internalFiles = Get-ChildItem $internalFunctions -Filter *.ps1 | - # Select-Object -ExpandProperty BaseName | - # Where-Object { $_ -notlike "*.Tests" } + $internalFiles = Get-ChildItem $internalFunctions -Filter *.ps1 | + Select-Object -ExpandProperty BaseName | + Where-Object { $_ -notlike "*.Tests" } - # #$exportedFunctions = $script:manifest.ExportedFunctions.Values.Name - # $exportedFunctions = $script:manifest.FunctionsToExport + #$exportedFunctions = $script:manifest.ExportedFunctions.Values.Name + $exportedFunctions = $script:manifest.FunctionsToExport - # foreach ($f in $functionFiles) { - # It "Exports $f" { - # $exportedFunctions -contains $f | Should -Be $true - # } - # } + foreach ($f in $functionFiles) { + It "Exports $f" { + $exportedFunctions -contains $f | Should -Be $true + } + } - # foreach ($f in $internalFiles) { - # It "Does not export $f" { - # $exportedFunctions -contains $f | Should -Be $false - # } - # } - # } + foreach ($f in $internalFiles) { + It "Does not export $f" { + $exportedFunctions -contains $f | Should -Be $false + } + } + } Context "Style checking" {