Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Fix testify not being detected anymore (#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasGr authored and ramya-rao-a committed Oct 7, 2018
1 parent f8d9b57 commit d8cc00f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ statusBarItem.text = '$(x) Cancel Running Tests';
*/
const runningTestProcesses: cp.ChildProcess[] = [];

const testFuncRegex = /^Test.+|Example.+/;
const testFuncRegex = /^Test.+|^Example.+/;
const testMethodRegex = /^\(([^)]+)\)\.(Test.*)$/;
const benchmarkRegex = /^Benchmark.+/;

Expand Down Expand Up @@ -108,7 +108,7 @@ export function getTestFunctions(doc: vscode.TextDocument, token: vscode.Cancell
return documentSymbolProvider
.provideDocumentSymbols(doc, token)
.then(symbols => {
const testify = symbols.some(sym => sym.kind === vscode.SymbolKind.Module && sym.name === 'github.com/stretchr/testify/suite');
const testify = symbols.some(sym => sym.kind === vscode.SymbolKind.Namespace && sym.name === '"github.com/stretchr/testify/suite"');
return symbols.filter(sym =>
sym.kind === vscode.SymbolKind.Function
&& (testFuncRegex.test(sym.name) || (testify && testMethodRegex.test(sym.name)))
Expand Down

0 comments on commit d8cc00f

Please sign in to comment.