From d8cc00f322040803536fdc3b38c343aa2e171d36 Mon Sep 17 00:00:00 2001 From: Mathias Griffe Date: Sun, 7 Oct 2018 04:06:05 +0200 Subject: [PATCH] Fix testify not being detected anymore (#1969) --- src/testUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testUtils.ts b/src/testUtils.ts index abc7fadae..28aeef4ff 100644 --- a/src/testUtils.ts +++ b/src/testUtils.ts @@ -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.+/; @@ -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)))