Skip to content

Commit 217488e

Browse files
committed
Add smoke tests used for deployments
1 parent 2bc5898 commit 217488e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

deploy/Invoke-SmokeTests.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# These tests are runs as part of the deployment process to ensure the newly published module is working as expected.
2+
# These tests run against the installed module, not the source code, so they do not use mocks and are more of a real-world test.
3+
# Since mocks are not used, we must be careful to not rely on state stored on the machine, such as a module Configuration file.
4+
# To run these tests on your local machine, see the comments in the BeforeAll block.
5+
6+
BeforeAll {
7+
Import-Module -Name YourModuleName -Force
8+
9+
# To run these tests on your local machine, comment out the Import-Module command above and uncomment the one below.
10+
# Do this to use the module version from source code, not the installed version.
11+
# This is necessary to test functionality that you've added to the module, but have not yet published and installed.
12+
# Import-Module "$PSScriptRoot\..\src\YourModuleName" -Force
13+
}
14+
15+
Describe 'Get-HelloWorld' {
16+
It 'Should return "Hello, World!"' {
17+
$expected = 'Hello, World!*'
18+
$result = Get-HelloWorld
19+
$result | Should -BeLike $expected
20+
}
21+
}

0 commit comments

Comments
 (0)