diff --git a/package.json b/package.json index eca98ab..e98207d 100644 --- a/package.json +++ b/package.json @@ -34,12 +34,15 @@ "main": "./out/src/extension", "contributes": { "views": { - "explorer": [{ - "id": "dotnetTestExplorer", - "name": ".NET Test Explorer" - }] + "explorer": [ + { + "id": "dotnetTestExplorer", + "name": ".NET Test Explorer" + } + ] }, - "commands": [{ + "commands": [ + { "command": "dotnet-test-explorer.refreshTestExplorer", "title": "Refresh", "icon": { @@ -61,7 +64,8 @@ } ], "menus": { - "view/title": [{ + "view/title": [ + { "command": "dotnet-test-explorer.refreshTestExplorer", "when": "view == dotnetTestExplorer", "group": "navigation@1" @@ -72,11 +76,13 @@ "group": "navigation@0" } ], - "view/item/context": [{ - "command": "dotnet-test-explorer.runTest", - "when": "view == dotnetTestExplorer", - "group": "dotnetTestExplorer@0" - }] + "view/item/context": [ + { + "command": "dotnet-test-explorer.runTest", + "when": "view == dotnetTestExplorer", + "group": "dotnetTestExplorer@0" + } + ] }, "configuration": { "type": "object", diff --git a/src/dotnetTestExplorer.ts b/src/dotnetTestExplorer.ts index 1562055..9b9ca32 100644 --- a/src/dotnetTestExplorer.ts +++ b/src/dotnetTestExplorer.ts @@ -89,8 +89,13 @@ export class DotnetTestExplorer implements TreeDataProvider { const structuredTests = {}; fullNames.forEach((name: string) => { - const parts = name.split("."); - this.addToObject(structuredTests, parts); + // this regex matches test names that include data in them - for e.g. + // Foo.Bar.BazTest(p1=10, p2="blah.bleh") + const match = /([^\(]+)(.*)/g.exec(name); + if (match && match.length > 1) { + const parts = match[1].split("."); + this.addToObject(structuredTests, parts); + } }); const root = this.createTestNode("", structuredTests);