New to Pester question

Welcome Forums Pester New to Pester question

This topic contains 2 replies, has 3 voices, and was last updated by

 
Keymaster
3 months, 4 weeks ago.

  • Author
    Posts
  • #104710

    Participant
    Points: 22
    Rank: Member

    Hi all,
    I'm just starting to learn Pester and I'm curious how to keep my test scripts separate from my Private/Public functions. I have a Private, Public, Test folder to keep everything in its own directory. Running New-Fixture creates the script file and script.test file in the same directory. I'm wondering how others keep their test directory separate from the function directories. Primarily how to are you setting the pathing in your *.test.ps1 files.

    \--- Module
        \--- Private
        \--- Public
             \--- Do-Something.ps1
        \--- Test
             \--- Do.Something.test.ps1
        \--- Module.psd1
        \--- Module.psm1
    
    
    		
    	
  • #104758

    Keymaster
    Points: 1,625
    Helping HandTeam Member
    Rank: Community Hero

    Six of one, half dozen of another. New-TestFramework takes a pretty one-size-fits-all approach; you can (obviously) modify what it produces and set it up however you like. That said, I've not run across anyone separating private/public functions in that way before, but having a /Test(s) folder is obviously pretty standard.

  • #111982

    Participant
    Points: 1
    Rank: Member

    Maybe not the answer you're looking for, but once you have a certain structure in mind, creating a standard structure template can also be done using Plaster...

    https://github.com/PowerShell/Plaster

    Or download it from the PS Gallery...

The topic ‘New to Pester question’ is closed to new replies.