|
| 1 | +// Available variables which can be used inside of strings. |
| 2 | +// ${workspaceRoot}: the root folder of the team |
| 3 | +// ${file}: the current opened file |
| 4 | +// ${relativeFile}: the current opened file relative to workspaceRoot |
| 5 | +// ${fileBasename}: the current opened file's basename |
| 6 | +// ${fileDirname}: the current opened file's dirname |
| 7 | +// ${fileExtname}: the current opened file's extension |
| 8 | +// ${cwd}: the current working directory of the spawned process |
| 9 | +{ |
| 10 | + // See https://go.microsoft.com/fwlink/?LinkId=733558 |
| 11 | + // for the documentation about the tasks.json format |
| 12 | + "version": "0.1.0", |
| 13 | + |
| 14 | + // Start PowerShell |
| 15 | + "windows": { |
| 16 | + "command": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" |
| 17 | + }, |
| 18 | + "linux": { |
| 19 | + "command": "/usr/bin/powershell" |
| 20 | + }, |
| 21 | + "osx": { |
| 22 | + "command": "/usr/local/bin/powershell" |
| 23 | + }, |
| 24 | + |
| 25 | + // The command is a shell script |
| 26 | + "isShellCommand": true, |
| 27 | + |
| 28 | + // Show the output window always |
| 29 | + "showOutput": "always", |
| 30 | + |
| 31 | + "args": [ |
| 32 | + "-NoProfile", "-ExecutionPolicy", "Bypass" |
| 33 | + ], |
| 34 | + |
| 35 | + // Associate with test task runner |
| 36 | + "tasks": [ |
| 37 | + { |
| 38 | + "taskName": "Test", |
| 39 | + "suppressTaskName": true, |
| 40 | + "isTestCommand": true, |
| 41 | + "showOutput": "always", |
| 42 | + "args": [ |
| 43 | + "Write-Host 'Invoking Pester'; Import-Module Pester; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};", |
| 44 | + "Invoke-Command { Write-Host 'Completed Test task in task runner.' }" |
| 45 | + ], |
| 46 | + "problemMatcher": [ |
| 47 | + { |
| 48 | + "owner": "powershell", |
| 49 | + "fileLocation": ["absolute"], |
| 50 | + "severity": "error", |
| 51 | + "pattern": [ |
| 52 | + { |
| 53 | + "regexp": "^\\s*(\\[-\\]\\s*.*?)(\\d+)ms\\s*$", |
| 54 | + "message": 1 |
| 55 | + }, |
| 56 | + { |
| 57 | + "regexp": "^\\s+at\\s+[^,]+,\\s*(.*?):\\s+line\\s+(\\d+)$", |
| 58 | + "file": 1, |
| 59 | + "line": 2 |
| 60 | + } |
| 61 | + ] |
| 62 | + } |
| 63 | + ] |
| 64 | + } |
| 65 | + ] |
| 66 | +} |
0 commit comments