Created
November 5, 2015 21:26
-
-
Save nohwnd/e064d04fad050fa9b178 to your computer and use it in GitHub Desktop.
Pester problem matcher for VS Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "DS"{ | |
it "skipped" {} -skip | |
it "pending" {} -Pending | |
It "throw" { throw "sdfad" } | |
It "assertion fail" {1 | should be 10 } | |
It "string assertion fail" {"asdf" | should be "ffsad" } | |
it "success" {"adsf"} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Describing DS | |
[!] skipped 303ms | |
[?] pending 42ms | |
[-] throw 52ms | |
sdfad | |
at line: 4 in C:\Users\nohwnd\Desktop\vscode\Untitled18.tests.ps1 | |
[-] assertion fail 63ms | |
Expected: {10} | |
But was: {1} | |
at line: 5 in C:\Users\nohwnd\Desktop\vscode\Untitled18.tests.ps1 | |
5: It "assertion fail" {1 | should be 10 } | |
[-] string assertion fail 36ms | |
Expected string length 5 but was 4. Strings differ at index 0. | |
Expected: {ffsad} | |
But was: {asdf} | |
-----------^ | |
at line: 6 in C:\Users\nohwnd\Desktop\vscode\Untitled18.tests.ps1 | |
6: It "string assertion fail" {"asdf" | should be "ffsad" } | |
[+] success 13ms | |
Tests completed in 512ms | |
Passed: 1 Failed: 3 Skipped: 1 Pending: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.1.0", | |
"command": "powershell", | |
"isShellCommand": true, | |
"args": ["Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process; Invoke-Pester"], | |
"showOutput": "always", | |
"fileLocation": "absolute", | |
"tasks": [ { | |
"taskName" : "test", | |
"isTestCommand" : true, | |
"suppressTaskName": true, | |
"problemMatcher": [{ | |
"owner": "pester", | |
"severity": "error", | |
"pattern":[ { | |
"regexp": "^\\s*\\[([-])\\]\\s+(.*)\\s+.*$", | |
"message": 2 | |
}, | |
{ | |
"regexp": "(.*)", | |
"message": 1 | |
}, | |
{ | |
"regexp": "^.*\\:\\s*(\\d+)\\s*in\\s*(.*)\\s*$", | |
"line": 1, | |
"file": 2, | |
"loop": true | |
}] | |
}, | |
{ | |
"owner": "pester", | |
"severity": "error", | |
"pattern":[ { | |
"regexp": "^\\s*\\[([-])\\]\\s+(.*)\\s+.*$", | |
"message": 2 | |
}, | |
{ | |
"regexp": "(.*)", | |
"message": 1 | |
}, | |
{ | |
"regexp": "(.*)", | |
"message": 1 | |
}, | |
{ | |
"regexp": "^.*\\:\\s*(\\d+)\\s*in\\s*(.*)\\s*$", | |
"line": 1, | |
"file": 2, | |
"loop": true | |
}] | |
}, | |
{ | |
"owner": "pester", | |
"severity": "error", | |
"pattern":[ { | |
"regexp": "^\\s*\\[([-])\\]\\s+(.*)\\s+.*$", | |
"message": 2 | |
}, | |
{ | |
"regexp": "(.*)", | |
"message": 1 | |
}, | |
{ | |
"regexp": "(.*)", | |
"message": 1 | |
}, | |
{ | |
"regexp": "(.*)", | |
"message": 1 | |
}, | |
{ | |
"regexp": "(.*)", | |
"message": 1 | |
}, | |
{ | |
"regexp": "^.*\\:\\s*(\\d+)\\s*in\\s*(.*)\\s*$", | |
"line": 1, | |
"file": 2, | |
"loop": true | |
}] | |
}, | |
{ | |
"owner": "pester", | |
"severity": "info", | |
"pattern":{ | |
//match skipped tests | |
"regexp": "^\\s*\\[?\\]\\s+(.*)\\s+.*$", | |
"message": 2 | |
//missing file so this does not work | |
} | |
}, | |
{ | |
"owner": "pester", | |
"severity": "warning", | |
"pattern":{ | |
//match pending tests | |
"regexp": "^\\s*\\[?\\]\\s+(.*)\\s+.*$", | |
"message": 2 | |
} | |
}] | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment