Skip to content

Commit

Permalink
docs: Add solution to ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
deadlydog committed Aug 12, 2023
1 parent dd98932 commit 26524a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ You could also simply run `Invoke-Pester` from the PowerShell terminal at the re
When Pester runs on the build server with GitHub Actions though, the MyClassInSeparateFile module fails with the error above.

[![build and test workflow](https://github.com/deadlydog/PowerShell.Experiment.ClassInModule/actions/workflows/build-and-test-powershell-module.yml/badge.svg)](https://github.com/deadlydog/PowerShell.Experiment.ClassInModule/actions/workflows/build-and-test-powershell-module.yml)

## Solution

It seems that everything works fine if instead of using `using module` to import the class, we dot-source the class file instead, as shown by the [ModuleWithClassInSeparateFileIncludedWithDotSourcing psm1 file](/src/ModuleWithClassInSeparateFileIncludedWithDotSourcing/ModuleWithClassInSeparateFileIncludedWithDotSourcing.psm1).

0 comments on commit 26524a4

Please sign in to comment.