-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInvoke-MocksTests.ps1
40 lines (26 loc) · 1.51 KB
/
Invoke-MocksTests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<#-----------------------------------------------------------------------------
PowerShell Testing with Pester
This sample code is part of a series of articles entitled
"Pester the Tester - Testing PowerShell Code"
located on RedGate's SimpleTalk website. You can find all of the authors
articles at: http://arcanecode.red
Author: Robert C. Cain | @ArcaneCode | arcane@arcanetc.com
http://arcanecode.me
This code module is Copyright (c) 2018 Robert C. Cain. All rights reserved.
The code herein is for demonstration purposes. No warranty or guarentee
is implied or expressly granted.
This code may not be reproduced in whole or in part without the express
written consent of the author. You may use it within your own projects.
This file simply shows how to invoke a pester test, in this example
calling the specific file mentioned in the above article.
-----------------------------------------------------------------------------#>
# Set tests location
$dir = "C:\Users\fastewaie\Documents\Dev\TestPester"
Set-Location $dir
# Invoke all the tests in the file
Invoke-Pester "$dir\Mocks-PretendToDoSomething.Tests.ps1"
# Add these lines so you can run just certain sets of tests
Invoke-Pester "$dir\Mocks-PretendToDoSomething.Tests.ps1" -Tag 'Unit'
Invoke-Pester "$dir\Mocks-PretendToDoSomething.Tests.ps1" -Tag 'Integration'
Invoke-Pester "$dir\Mocks-PretendToDoSomething.Tests.ps1" -Tag 'Acceptance'
Invoke-Pester "$dir\Mocks-PretendToDoSomething.Tests.ps1" -Tag 'Unit', 'Integration'