Repository navigation
Add autoload for test modules #3342
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,4 @@ | ||
| Import-Module $PSScriptRoot\..\..\Common\Test.Helpers.psm1 -ErrorAction SilentlyContinue | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing the module imports just doesn't seem right to me. If you invoke-pester directly, it doesn't even tell you what is wrong.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a new helper modules and using of existing helper modules need to be documented. I believe this is enough. Maybe Jason Shirk (@lzybkr) has something to add. |
||
| Import-Module $PSScriptRoot\..\..\Common\TestHostCS.psm1 -ErrorAction SilentlyContinue | ||
|
|
||
| Describe "Tests for parameter binding" -Tags "CI" { | ||
| Describe "Tests for parameter binding" -Tags "CI" { | ||
| Context 'Test of Mandatory parameters' { | ||
| BeforeAll { | ||
| $f = "function get-foo { param([Parameter(mandatory=`$true)] `$a) `$a };" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # | ||
| # Module manifest for module 'TestHostCS' | ||
| # | ||
|
|
||
| @{ | ||
|
|
||
| # Script module or binary module file associated with this manifest. | ||
| RootModule = 'TestHostCS.psm1' | ||
|
|
||
| # Version number of this module. | ||
| ModuleVersion = '1.0' | ||
|
|
||
| # ID used to uniquely identify this module | ||
| GUID = '40a19c05-d765-41a1-995e-98ca5f247ee1' | ||
|
|
||
| # Company or vendor of this module | ||
| CompanyName = 'Microsoft Corporation' | ||
|
|
||
| # Copyright statement for this module | ||
| Copyright = 'Copyright (C) Microsoft Corporation, All rights reserved.' | ||
|
|
||
| # Description of the functionality provided by this module | ||
| Description = 'Simple console host for console IO tests.' | ||
|
|
||
| # Minimum version of the Windows PowerShell engine required by this module | ||
| # PowerShellVersion = '' | ||
|
|
||
| # Name of the Windows PowerShell host required by this module | ||
| # PowerShellHostName = '' | ||
|
|
||
| # Minimum version of the Windows PowerShell host required by this module | ||
| # PowerShellHostVersion = '' | ||
|
|
||
| # Minimum version of Microsoft .NET Framework required by this module | ||
| # DotNetFrameworkVersion = '' | ||
|
|
||
| # Minimum version of the common language runtime (CLR) required by this module | ||
| # CLRVersion = '' | ||
|
|
||
| # Processor architecture (None, X86, Amd64) required by this module | ||
| # ProcessorArchitecture = '' | ||
|
|
||
| # Modules that must be imported into the global environment prior to importing this module | ||
| # RequiredModules = @() | ||
|
|
||
| # Assemblies that must be loaded prior to importing this module | ||
| # RequiredAssemblies = @() | ||
|
|
||
| # Script files (.ps1) that are run in the caller's environment prior to importing this module. | ||
| # ScriptsToProcess = @() | ||
|
|
||
| # Type files (.ps1xml) to be loaded when importing this module | ||
| # TypesToProcess = @() | ||
|
|
||
| # Format files (.ps1xml) to be loaded when importing this module | ||
| # FormatsToProcess = @() | ||
|
|
||
| # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess | ||
| # NestedModules = @() | ||
|
|
||
| # Functions to export from this module | ||
| FunctionsToExport = 'New-TestHost' | ||
|
|
||
| # Cmdlets to export from this module | ||
| #CmdletsToExport = '*' | ||
|
|
||
| # Variables to export from this module | ||
| #VariablesToExport = '*' | ||
|
|
||
| # Aliases to export from this module | ||
| #AliasesToExport = '*' | ||
|
|
||
| # DSC resources to export from this module | ||
| # DscResourcesToExport = @() | ||
|
|
||
| # List of all modules packaged with this module | ||
| # ModuleList = @() | ||
|
|
||
| # List of all files packaged with this module | ||
| # FileList = @() | ||
|
|
||
| # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. | ||
| PrivateData = @{ | ||
|
|
||
| PSData = @{ | ||
|
|
||
| # Tags applied to this module. These help with module discovery in online galleries. | ||
| # Tags = @() | ||
|
|
||
| # A URL to the license for this module. | ||
| # LicenseUri = '' | ||
|
|
||
| # A URL to the main website for this project. | ||
| # ProjectUri = '' | ||
|
|
||
| # A URL to an icon representing this module. | ||
| # IconUri = '' | ||
|
|
||
| # ReleaseNotes of this module | ||
| # ReleaseNotes = '' | ||
|
|
||
| } # End of PSData hashtable | ||
|
|
||
| } # End of PrivateData hashtable | ||
|
|
||
| # HelpInfo URI of this module | ||
| # HelpInfoURI = '' | ||
|
|
||
| # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. | ||
| # DefaultCommandPrefix = '' | ||
|
|
||
| } | ||
|
|
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.
If we are going to require everyone to use
Start-PSPesterwhich btw someone misnamed this function, it should beInvoke-PSPestersince it is synchronous, it should have the-testnameparameter.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.
I added import of helper modules in current session too so it is not required to use
Start-PSPester- it is worked well.\Out-Host.Tests.ps1