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

Commit

Permalink
Mark test methods as testify suite methods only if testify framework …
Browse files Browse the repository at this point in the history
…is used #1911
  • Loading branch information
ramya-rao-a committed Sep 10, 2018
1 parent 3477829 commit a11c5aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ export function getTestFunctions(doc: vscode.TextDocument, token: vscode.Cancell
let documentSymbolProvider = new GoDocumentSymbolProvider();
return documentSymbolProvider
.provideDocumentSymbols(doc, token)
.then(symbols =>
symbols.filter(sym =>
.then(symbols => {
const testify = symbols.some(sym => sym.kind === vscode.SymbolKind.Module && sym.name === "github.com/stretchr/testify/suite");
return symbols.filter(sym =>
sym.kind === vscode.SymbolKind.Function
&& (sym.name.startsWith('Test') || sym.name.startsWith('Example') || testSuiteMethodRegex.test(sym.name))
&& (sym.name.startsWith('Test') || sym.name.startsWith('Example') || (testify && testSuiteMethodRegex.test(sym.name)))
)
);
});
}

/**
Expand Down

0 comments on commit a11c5aa

Please sign in to comment.