New to Pester question

Welcome Forums Pester New to Pester question

Viewing 2 reply threads
  • Author
    • #104710
      Topics: 21
      Replies: 27
      Points: 0
      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
      Topics: 18
      Replies: 4872
      Points: 1,903
      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
      Topics: 1
      Replies: 2
      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…

      Or download it from the PS Gallery…

Viewing 2 reply threads
  • The topic ‘New to Pester question’ is closed to new replies.