Skip to content

Instantly share code, notes, and snippets.

@sfdcale
Created November 1, 2019 04:33
Show Gist options
  • Select an option

  • Save sfdcale/bfb1817f1bf38a0748d3c6f4e3c987d5 to your computer and use it in GitHub Desktop.

Select an option

Save sfdcale/bfb1817f1bf38a0748d3c6f4e3c987d5 to your computer and use it in GitHub Desktop.
This command prints all the test class names present in the org.
sfdx force:data:soql:query
--query="SELECT Id,Name,SymbolTable FROM ApexClass WHERE NamespacePrefix = ''"
--usetoolingapi
--targetusername=prod
--json
| jq '.result.records[] | select(.SymbolTable != null)
| select(.SymbolTable.methods[].annotations[].name == "IsTest")'
| jq '.Name' | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment