Skip to content

Commit 7cd3f99

Browse files
committed
Merge pull request #105 from rkeithhill/rkeithhill/update-tasks-for-pester340
Updates the examples\.vscode\tasks.json file for Pester 3.4.0
2 parents 7525e11 + bb41093 commit 7cd3f99

File tree

1 file changed

+20
-91
lines changed

1 file changed

+20
-91
lines changed

examples/.vscode/tasks.json

+20-91
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
// A task runner that invokes Pester which runs all Pester tests under the
1+
// A task runner that invokes Pester to run all Pester tests under the
22
// current workspace folder.
33

4+
// NOTE: This Pester task runner requires an updated version of Pester (>=3.4.0)
5+
// in order for the problemMatcher to find failed test information (message, line, file).
6+
// If you don't have that version, you can update Pester from the PSGallery like so:
7+
//
8+
// PS C:\> Update-Module Pester
9+
//
10+
// If that gives an error like:
11+
// "Module 'Pester' was not installed by using Install-Module, so it cannot be updated."
12+
// then execute:
13+
//
14+
// PS C:\> Install-Module Pester -Scope CurrentUser -Force
15+
//
16+
417
// Available variables which can be used inside of strings.
518
// ${workspaceRoot}: the root folder of the team
619
// ${file}: the current opened file
@@ -21,11 +34,9 @@
2134
// Show the output window always
2235
"showOutput": "always",
2336

24-
// Allow Pester to invoke scripts and run Pester
2537
"args": [
26-
"-NoProfile",
27-
"Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process;",
28-
"Write-Host 'Invoking Pester...'; Invoke-Pester;",
38+
"-NoProfile", "-ExecutionPolicy", "Bypass",
39+
"Write-Host 'Invoking Pester...'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};",
2940
"Invoke-Command { Write-Host \"Completed all tasks in task runner: $($args[0])\" } -args"
3041
],
3142

@@ -41,95 +52,13 @@
4152
"severity": "error",
4253
"pattern": [
4354
{
44-
"regexp": "^\\s*\\[-\\](.*?)(\\d+)ms\\s*$",
45-
"message": 1
46-
},
47-
{
48-
"regexp": "^.*$"
49-
},
50-
{
51-
"regexp": "^\\s+at line: (\\d+) in (.*)$",
52-
"line": 1,
53-
"file": 2,
54-
"message": 2
55-
}
56-
]
57-
},
58-
{
59-
"owner": "powershell",
60-
"fileLocation": ["absolute"],
61-
"severity": "error",
62-
"pattern": [
63-
{
64-
"regexp": "^\\s*\\[-\\](.*?)(\\d+)ms\\s*$",
65-
"message": 1
66-
},
67-
{
68-
"regexp": "^.*$"
69-
},
70-
{
71-
"regexp": "^.*$"
72-
},
73-
{
74-
"regexp": "^\\s+at line: (\\d+) in (.*)$",
75-
"line": 1,
76-
"file": 2,
77-
"message": 2
78-
}
79-
]
80-
},
81-
{
82-
"owner": "powershell",
83-
"fileLocation": ["absolute"],
84-
"severity": "error",
85-
"pattern": [
86-
{
87-
"regexp": "^\\s*\\[-\\](.*?)(\\d+)ms\\s*$",
55+
"regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$",
8856
"message": 1
8957
},
9058
{
91-
"regexp": "^.*$"
92-
},
93-
{
94-
"regexp": "^.*$"
95-
},
96-
{
97-
"regexp": "^.*$"
98-
},
99-
{
100-
"regexp": "^\\s+at line: (\\d+) in (.*)$",
101-
"line": 1,
102-
"file": 2,
103-
"message": 2
104-
}
105-
]
106-
},
107-
{
108-
"owner": "powershell",
109-
"fileLocation": ["absolute"],
110-
"severity": "error",
111-
"pattern": [
112-
{
113-
"regexp": "^\\s*\\[-\\](.*?)(\\d+)ms\\s*$",
114-
"message": 1
115-
},
116-
{
117-
"regexp": "^.*$"
118-
},
119-
{
120-
"regexp": "^.*$"
121-
},
122-
{
123-
"regexp": "^.*$"
124-
},
125-
{
126-
"regexp": "^.*$"
127-
},
128-
{
129-
"regexp": "^\\s+at line: (\\d+) in (.*)$",
130-
"line": 1,
131-
"file": 2,
132-
"message": 2
59+
"regexp": "^\\s+at\\s+[^,]+,\\s*(.*?):\\s+line\\s+(\\d+)$",
60+
"file": 1,
61+
"line": 2
13362
}
13463
]
13564
}

0 commit comments

Comments
 (0)