-
Notifications
You must be signed in to change notification settings - Fork 98
Add test for save script using Save-PSResource
without -IncludeXml
#1613
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
Add test for save script using Save-PSResource
without -IncludeXml
#1613
Conversation
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thanks for adding this test and correcting the regression of our older test. I've added a few suggestions, mostly nitpicks to use PowerShell commands as we do throughout our other tests, but once that's in I'll approve, thanks @o-l-a-v !
It "Save script without using -IncludeXML" { | ||
Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository | Should -Not -Throw | ||
|
||
$SavedScriptFile = [System.IO.Path]::Combine($SaveDir,('{0}.ps1' -f $testScriptName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpick to use Join-Path
to be consistent with the rest of our tests
$SavedScriptFile = [System.IO.Path]::Combine($SaveDir,('{0}.ps1' -f $testScriptName)) | |
$SavedScriptFile = Join-Path -Path $SaveDir -ChildPath "$testScriptName.ps1" |
Save-PSResource -Name $testScriptName -Repository $PSGalleryName -Path $SaveDir -TrustRepository | Should -Not -Throw | ||
|
||
$SavedScriptFile = [System.IO.Path]::Combine($SaveDir,('{0}.ps1' -f $testScriptName)) | ||
[System.IO.File]::Exists($SavedScriptFile) | Should -BeTrue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nitpick to use powershell command Test-Path
to be consistent with the rest of our tests
[System.IO.File]::Exists($SavedScriptFile) | Should -BeTrue | |
Test-Path -Path $SavedScriptFile | Should -BeTrue |
@anamnavi : @SydneyhSmith told me to put tests into #1614 in #1614 (comment). So close this PR and continue in mentioned PR? |
@o-l-a-v ah yes, I missed that earlier. I'll close this PR. And add the comments from this to that PR. |
PR Summary
Add test for #1609
Which probably broke when fixing #1335
PR Context
Add test "Save script without using -IncludeXML" for saving script using
Save-PSResource
without-IncludeXml
.Also fix typo and missing
-IncludeXml
in existing test "Save script using -IncludeXML".PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.