Skip to content

Commit 55d7995

Browse files
committed
Update Examples tasks.json for 2.0 schema
Fix #1111
1 parent 8929d69 commit 55d7995

File tree

1 file changed

+52
-39
lines changed

1 file changed

+52
-39
lines changed

examples/.vscode/tasks.json

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// A task runner that invokes Pester to run all Pester tests under the
22
// current workspace folder.
3-
4-
// NOTE: This Test task runner requires an updated version of Pester (>=3.4.0)
3+
// NOTE: This Test task runner requires an updated version of Pester (>=4.0.3)
54
// in order for the problemMatcher to find failed test information (message, line, file).
65
// If you don't have that version, you can update Pester from the PowerShell Gallery
76
// with this command:
@@ -14,13 +13,11 @@
1413
//
1514
// PS C:\> Install-Module Pester -Scope CurrentUser -Force
1615
//
17-
1816
// NOTE: The Clean, Build and Publish tasks require PSake. PSake can be installed
1917
// from the PowerShell Gallery with this command:
2018
//
2119
// PS C:\> Install-Module PSake -Scope CurrentUser -Force
2220
//
23-
2421
// Available variables which can be used inside of strings.
2522
// ${workspaceRoot}: the root folder of the team
2623
// ${file}: the current opened file
@@ -29,58 +26,74 @@
2926
// ${fileExtname}: the current opened file's extension
3027
// ${cwd}: the current working directory of the spawned process
3128
{
32-
"version": "2.0.0",
29+
"version": "2.0.0",
3330

34-
// Start PowerShell
3531
"windows": {
36-
"command": "${env:windir}/System32/WindowsPowerShell/v1.0/powershell.exe",
37-
"args": [ "-NoProfile", "-ExecutionPolicy", "Bypass" ]
32+
"options": {
33+
"shell": {
34+
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
35+
"args": [
36+
"-NoProfile",
37+
"-ExecutionPolicy",
38+
"Bypass",
39+
"-Command"
40+
]
41+
}
42+
}
3843
},
3944
"linux": {
40-
"command": "/usr/bin/powershell",
41-
"args": [ "-NoProfile" ]
45+
"options": {
46+
"shell": {
47+
"executable": "/usr/bin/pwsh",
48+
"args": [
49+
"-NoProfile",
50+
"-Command"
51+
]
52+
}
53+
}
4254
},
4355
"osx": {
44-
"command": "/usr/local/bin/powershell",
45-
"args": [ "-NoProfile" ]
56+
"options": {
57+
"shell": {
58+
"executable": "/usr/local/bin/pwsh",
59+
"args": [
60+
"-NoProfile",
61+
"-Command"
62+
]
63+
}
64+
}
4665
},
4766

4867
// Associate with test task runner
4968
"tasks": [
5069
{
51-
"taskName": "Clean",
52-
"suppressTaskName": true,
53-
"args": [
54-
"Write-Host 'Invoking PSake...'; Invoke-PSake build.ps1 -taskList Clean;",
55-
"Invoke-Command { Write-Host 'Completed Clean task in task runner.' }"
56-
]
70+
"label": "Clean",
71+
"type": "shell",
72+
"command": "Invoke-PSake build.ps1 -taskList Clean"
5773
},
5874
{
59-
"taskName": "Build",
60-
"suppressTaskName": true,
61-
"isBuildCommand": true,
62-
"args": [
63-
"Write-Host 'Invoking PSake...'; Invoke-PSake build.ps1 -taskList Build;",
64-
"Invoke-Command { Write-Host 'Completed Build task in task runner.' }"
65-
]
75+
"label": "Build",
76+
"type": "shell",
77+
"command": "Invoke-PSake build.ps1 -taskList Build",
78+
"group": {
79+
"kind": "build",
80+
"isDefault": true
81+
}
6682
},
6783
{
68-
"taskName": "Publish",
69-
"suppressTaskName": true,
70-
"args": [
71-
"Write-Host 'Invoking PSake...'; Invoke-PSake build.ps1 -taskList Publish;",
72-
"Invoke-Command { Write-Host 'Completed Publish task in task runner.' }"
73-
]
84+
"label": "Test",
85+
"type": "shell",
86+
"command": "Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true}",
87+
"group": {
88+
"kind": "test",
89+
"isDefault": true
90+
},
91+
"problemMatcher": "$pester"
7492
},
7593
{
76-
"taskName": "Test",
77-
"suppressTaskName": true,
78-
"isTestCommand": true,
79-
"args": [
80-
"Write-Host 'Invoking Pester...'; $ProgressPreference = 'SilentlyContinue'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};",
81-
"Invoke-Command { Write-Host 'Completed Test task in task runner.' }"
82-
],
83-
"problemMatcher": "$pester"
94+
"label": "Publish",
95+
"type": "shell",
96+
"command": "Invoke-PSake build.ps1 -taskList Publish"
8497
}
8598
]
8699
}

0 commit comments

Comments
 (0)