-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support test files alongside source like Pester suggests #108
Comments
Well, obviously I disagree that it's standard or the best way (and Pester itself certainly doesn't do that) but I would be happy to add support for You can easily hard code that in a fork for yourself though. You would just need to change line 206 of Build-Module.ps1 # SilentlyContinue because there don't *HAVE* to be functions at all
$AllScripts = Get-ChildItem -Path @($ModuleInfo.SourceDirectories).ForEach{ Join-Path $ModuleInfo.ModuleBase $_ } -Filter *.ps1 -Recurse -ErrorAction SilentlyContinue to add # SilentlyContinue because there don't *HAVE* to be functions at all
$AllScripts = Get-ChildItem -Path @($ModuleInfo.SourceDirectories).ForEach{ Join-Path $ModuleInfo.ModuleBase $_ } -Filter *.ps1 -Exclude *.tests.ps1 -Recurse -ErrorAction SilentlyContinue |
I filed an issue against the Pester docs, because I can't find anyone who does that. I think they're talking about it from a "my first PowerShell script" practice, not module developers. |
@sjwestern putting test files next to your production files is just one of the ways to structure your projects. Pester suggests it as an option, because it is the simplest way to do it for simple projects. More advanced projects are usually split their code into src and tst / test / tests folder. The guidance in Pester docs was updated to reflect that. |
Is it possible to have test files next to their source files instead of in a separate directory?
This seems to be pretty standard and is the Pester docs recommended way of doing it.
The text was updated successfully, but these errors were encountered: