From 2ca8396850f07f35fab516a594f89cd329e61422 Mon Sep 17 00:00:00 2001 From: Mathias Griffe Date: Fri, 5 Oct 2018 11:06:25 +0200 Subject: [PATCH] Fix testify not being detected anymore --- src/testUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testUtils.ts b/src/testUtils.ts index a879ef107..60ed2a1d9 100644 --- a/src/testUtils.ts +++ b/src/testUtils.ts @@ -23,7 +23,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.+/; @@ -99,7 +99,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)))