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

Fix testify not being detected anymore #1969

Merged
merged 1 commit into from
Oct 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.+/;

Expand Down Expand Up @@ -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)))
Expand Down